================
@@ -167,6 +172,14 @@ class DelayedDiagnostic {
     return DD;
   }
 
+  static DelayedDiagnostic makeForbiddenStatic(SourceLocation Loc) {
----------------
a-tarasyuk wrote:

I added a delayed diagnostic to handle the following two cases.

```c
inline int f13(int a[(static int){1}]) { // expected-warning {{non-constant 
static local variable in inline function may be different in different files}} \
                                         // expected-note {{use 'static' to 
give inline function 'f13' internal linkage}}
  return a[0];
}

inline int f14(int a[(static int){1}]);
```

When `BuildCompoundLiteralExpr` runs, the `FunctionDecl` is not yet complete, 
so it's not possible to tell whether it's a prototype or an inline definition. 
Once parsing is complete, f13 should produce a warning, while the f14 prototype 
should not.

https://github.com/llvm/llvm-project/pull/212559
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to