[clang] [clang] emit an error when the same identifier appears with both internal and external linkage in a translation unit (PR #78064)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 08:40:29 PST 2024


================
@@ -5,10 +5,10 @@ static int g0; // expected-note{{previous definition}}
 int g0; // expected-error{{non-static declaration of 'g0' follows static declaration}}
 
 static int g1;
-extern int g1;
+extern int g1; // expected-error{{the same identifier 'g1' appears with both internal and external linkage}}
----------------
AaronBallman wrote:

This is an example of code that should be fine per 6.2.2.p4

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


More information about the cfe-commits mailing list