EricWF added inline comments. ================ Comment at: lib/Sema/SemaExprCXX.cpp:4775 @@ +4774,3 @@ + // a 'constant initializer'. + else if ((VD->hasGlobalStorage() || + VD->getTLSKind() != VarDecl::TLS_None) && VD->hasInit()) { ---------------- EricWF wrote: > 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]. > Perhaps using `__has_constant_initializer` should emit a diagnostic when used on non-static, non-thread-local objects?
https://reviews.llvm.org/D23385 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits