Anastasia added inline comments.

================
Comment at: clang/lib/Sema/SemaDecl.cpp:12643
+      if (CXXRecordDecl *RD = Var->getType()->getAsCXXRecordDecl()) {
+        for (auto *ctor : RD->ctors()) {
+          if (ctor->isConstexpr() && ctor->getNumParams() == 0 &&
----------------
ctor -> Ctor


================
Comment at: clang/test/SemaOpenCLCXX/addrspace-constructors.clcpp:20
+kernel void k() {
+  __constant X cx1;
+  __constant X cx2(1);
----------------
Btw, even though your change doesn't modify this I would suggest to add a 
CodeGen test that checks the initialization of objects in IR is adequate.


================
Comment at: clang/test/SemaOpenCLCXX/addrspace-constructors.clcpp:36
+  Z() __local = default;
+  Z() __global = default;
+  constexpr Z() __constant : z(0) {}
----------------
We seem to be missing the coverage with __constant and `= default`.


================
Comment at: clang/test/SemaOpenCLCXX/addrspace-constructors.clcpp:42
+  int w;
+  constexpr W() __constant = default; // expected-error {{defaulted definition 
of default constructor is not constexpr}}
+};
----------------
I find the wording of the error a bit odd, but it is standard C++ though... 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102248

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

Reply via email to