EricWF marked an inline comment as done.

================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6807
@@ +6806,3 @@
+
+def err_has_constant_init_expression_trait_invalid_arg : Error<
+  "expression does not reference a named variable">;
----------------
Help improving this wording would be appreciated.

================
Comment at: lib/Sema/SemaExprCXX.cpp:4775
@@ +4774,3 @@
+      // a 'constant initializer'.
+      else if ((VD->hasGlobalStorage() ||
+          VD->getTLSKind() != VarDecl::TLS_None) && VD->hasInit()) {
----------------
jroelofs wrote:
> no else after return.
> 
> Also, what do you want this to do for `ParmVarDecl`s that happen to have an 
> initializer? i.e:
> 
> ```
> void foo(int i = 45) {}
> ```
I believe that case should return false. `i` isn't static or thread local so it 
doesn't have a "constant initializer" according to [basic.start.static].



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