efriedma added a comment.

That's roughly what I was thinking, yes.

The one missing piece is the code to modify the constructor priorities to make 
sure that "constant" variables get initialized first.  (This ensures we honor 
the C++ rules for "constant initialization".)



================
Comment at: clang/lib/Sema/SemaDecl.cpp:13896
+          Diag(var->getLocation(), diag::err_constexpr_var_requires_const_init)
+              << var << Init->getSourceRange();
+      }
----------------
I don't understand why this diagnostic is necessary.


================
Comment at: clang/test/CodeGenCXX/PR19955.cpp:10
+// CHECK-DAG: @"?varp@@3PAHA" = dso_local global ptr @"?var@@3HA"
+// X64-DAG: @"?varp@@3PEAHEA" = dso_local global ptr @"?var@@3HA"
 
----------------
We probably want to continue using "null" as the placeholder here, to avoid any 
confusion.


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

https://reviews.llvm.org/D137107

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

Reply via email to