jroelofs added a subscriber: jroelofs. ================ Comment at: lib/AST/Expr.cpp:2656 @@ +2655,3 @@ + AllowNonLiteral)) { + if (!CE->getNumArgs()) return true; + unsigned numArgs = CE->getNumArgs(); ---------------- no need for this `if`.
Also, I think the `for` should be written: ``` for (auto *Arg : CE->arguments()) if (Arg->isConstantInitializer(Ctx, false, Culprit)) return false; ``` ================ Comment at: lib/Sema/SemaExprCXX.cpp:4775 @@ +4774,3 @@ + // a 'constant initializer'. + else if ((VD->hasGlobalStorage() || + VD->getTLSKind() != VarDecl::TLS_None) && VD->hasInit()) { ---------------- 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) {} ``` https://reviews.llvm.org/D23385 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits