tra added inline comments.

================
Comment at: clang/lib/Sema/SemaOverload.cpp:12758-12764
+        std::optional<bool> MorePreferableByCUDA =
+            CheckCUDAPreference(FD, Result);
+        // If FD has different CUDA preference than Result.
+        if (MorePreferableByCUDA) {
+          // FD is less preferable than Result.
+          if (!*MorePreferableByCUDA)
+            continue;
----------------
Maybe `CheckCUDAPreference` should return -1/0/1 or an enum. std::optional does 
not seem to be very readable here.

E.g. `if(MorePreferableByCUDA)` sounds like it's going to be satisfied when FD 
is a better choice than Result, but it's not the case.
I think this would be easier to follow:
```
    if (CheckCUDAPreference(FD, Result) <= 0) // or `!= CP_BETTER`
         continue;
```



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154300/new/

https://reviews.llvm.org/D154300

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to