================ @@ -7813,6 +7813,32 @@ Sema::BuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo, diag::err_variable_object_no_init)) return ExprError(); } + } else if (LangOpts.C23 && ---------------- AaronBallman wrote:
I don't think these changes are quite sufficient because I think we need to handle more cases than just compound literals. Consider: ``` constexpr typeof(struct s *) x = 0; // declares `s` which is not an ordinary identifier constexpr struct S { int a, b; } y = { 0 }; // declares `S`, `a`, and `b`, none of which are ordinary identifiers constexpr int a = 0, b = 0; // declares `a` and `b` as ordinary identifiers auto c = (struct T { int x, y; }){0, 0}; // declares `T`, `x`, and `y`, none of which are ordinary identifiers constexpr int (*fp)(struct X { int x; } val) = 0; // declares `X` and `x` which are not ordinary identifiers ``` (https://godbolt.org/z/Pq87aMnch) https://github.com/llvm/llvm-project/pull/79845 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits