tra accepted this revision.
tra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Sema/SemaCUDA.cpp:538
       AllowedInit =
-          ((VD->getType()->isDependentType() || Init->isValueDependent()) &&
-           VD->isConstexpr()) ||
+          (VD->getType()->isDependentType() || Init->isValueDependent()) ||
           Init->isConstantInitializer(Context,
----------------
Nit, no need for `()` any more, as all parts of the expression ar `||`-ed 
together.


================
Comment at: clang/test/SemaCUDA/dependent-device-var.cu:8
+__device__ int fun1(T x) {
+  static __device__ int a = sizeof(x);
+  static __device__ int b = x;
----------------
So, the patch now allows using type-dependent constant expressions now. 
I'd add a comment highlighting this. It's not always obvious that the test's 
purpose is to verify the absence of an error.


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

https://reviews.llvm.org/D95840

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

Reply via email to