================ @@ -7141,7 +7141,13 @@ Sema::BuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo, return ExprError(); LiteralExpr = Result.get(); - bool isFileScope = !CurContext->isFunctionOrMethod(); + // We treat the compound literal as being at file scope if it's not in a + // function or method body, or within the function's prototype scope. This + // means the following compound literal is not at file scope: + // void func(char *para[(int [1]){ 0 }[0]); + const Scope *S = getCurScope(); + bool isFileScope = !CurContext->isFunctionOrMethod() && ---------------- tbaederr wrote:
```suggestion bool IsFileScope = !CurContext->isFunctionOrMethod() && ``` (Opportunity for cleanup) https://github.com/llvm/llvm-project/pull/132097 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits