Anastasia added a comment.

I feel that originally pointers were disallowed because they create the same 
issue as `size_t` and etc as their size is implementation depended but the same 
logic applies to images and other types that are even more implementation 
depended. Overall this bit of the spec is very inconsistent so I don't mind if 
we change the behavior to be whatever we find more helpful. However I would 
encourage to submit an issue to OpenCL-Docs to point out this inconsistency.



================
Comment at: clang/lib/Sema/SemaDecl.cpp:9493
+      // union. This restriction was lifted in OpenCL v2.0 with the 
introduction
+      // of SVM.
+      if (S.getLangOpts().getOpenCLCompatibleVersion() > 120 &&
----------------
To be honest I feel like it was a bug fix? Do you happen to have any record of 
the fix?


================
Comment at: clang/lib/Sema/SemaDecl.cpp:9494
+      // of SVM.
+      if (S.getLangOpts().getOpenCLCompatibleVersion() > 120 &&
+          (ParamType == PtrKernelParam || ParamType == PtrPtrKernelParam))
----------------
I think it should be possible to merge this with `if` below to avoid condition 
duplication.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143849

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

Reply via email to