[clang] [Clang] Use ExtWarn for static local variable in extern inline function (fixes #39524) (PR #166332)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 5 07:13:45 PST 2025
================
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -std=c11 -Wno-unused-variable -Wno-deprecated-non-prototype -Wno-inline -pedantic-errors -verify %s
+
+inline void f(void) { // expected-note {{use 'static' to give inline function 'f' internal linkage}}
+ static int x; // expected-error {{non-constant static local variable in inline function may be different in different files}}
+}
+
+int main(void) { return 0; }
----------------
Sirraide wrote:
```suggestion
```
No need for this to be here
https://github.com/llvm/llvm-project/pull/166332
More information about the cfe-commits
mailing list