[clang] Consider aggregate bases when checking if an InitListExpr is constant (PR #80519)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 2 18:30:27 PST 2024


================
@@ -3342,6 +3342,18 @@ bool Expr::isConstantInitializer(ASTContext &Ctx, bool IsForRef,
     if (ILE->getType()->isRecordType()) {
       unsigned ElementNo = 0;
       RecordDecl *RD = ILE->getType()->castAs<RecordType>()->getDecl();
+
+      // Check bases for C++17 aggregate initializers.
----------------
shafik wrote:

Should we be checking `CPlusPlus17` here? 

Also I would like to see a standard quote in the comments. I know we are not doing this locally but these are really helpful and we should be doing this more consistently.

https://github.com/llvm/llvm-project/pull/80519


More information about the cfe-commits mailing list