[clang] [Clang] Diagnose UB and emit error when identifier has both internal and external linkage (PR #192116)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 21 08:21:34 PDT 2026


================
@@ -24,19 +24,17 @@ void func2() {
   extern int b; // Ok
 }
 
-static int c, d;
+static int c, d; // expected-note {{previous definition is here}} expected-note {{previous definition is here}}
----------------
AaronBallman wrote:

```suggestion
static int c, d; // expected-note 2 {{previous definition is here}}
```

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


More information about the cfe-commits mailing list