Anastasia added inline comments.

================
Comment at: clang/lib/Sema/SemaDecl.cpp:6853
+    if (R->isReserveIDT() || R->isClkEventT() || R->isEventT() ||
+        R.getUnqualifiedType().getAsString() == "ndrange_t" || R->isQueueT()) {
       Se.Diag(NewVD->getLocation(),
----------------
cycheng wrote:
> Anastasia wrote:
> > Suggest swapping those as string comparisons are more costly.
> > 
> > However, does it work if there is a typedef of `ndrange_t` to some other 
> > name? Although it feels like the same issue might apply to other types 
> > diagnosed here...
> > does it work if there is a typedef of ndrange_t to some other name?
> No, should we recursively check it?
> Or do we have better way to handle this?
We should be able to do this by using canonical type in the checks:
https://clang.llvm.org/doxygen/classclang_1_1QualType.html#a900520b154ba282febbaa7267020ca3f


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

https://reviews.llvm.org/D112110

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

Reply via email to