majnemer added inline comments.

================
Comment at: lib/Sema/SemaDecl.cpp:10388-10390
@@ -10387,2 +10387,5 @@
 
+  // Cache the result of checking for constant initialization.
+  Optional<bool> HasConstInit;
+
   if (var->getTLSKind() == VarDecl::TLS_Static) {
----------------
You could use a lambda to abstract away the "check if it's cached, if not 
query" logic.

================
Comment at: lib/Sema/SemaDecl.cpp:10485
@@ +10484,3 @@
+  if (var->hasAttr<RequireConstantInitAttr>() && !Init)
+     Diag(var->getLocation(), diag::err_require_constant_init_failed);
+
----------------
Any reason not to use the already existing `err_init_element_not_constant`?


https://reviews.llvm.org/D23385



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

Reply via email to