================
@@ -1,45 +1,106 @@
-// RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -Wno-unused %s
+// RUN: %clang_cc1 -verify=c2y -std=c2y -Wall -pedantic -Wno-unused %s
+// RUN: %clang_cc1 -verify=c89-23 -std=c23 -Wall -pedantic -Wno-unused %s
+// RUN: %clang_cc1 -verify=c89-23 -std=c17 -Wall -pedantic -Wno-unused %s
+// RUN: %clang_cc1 -verify=c89-23 -std=c11 -Wall -pedantic -Wno-unused %s
+// RUN: %clang_cc1 -verify=c89-23 -std=c99 -Wall -pedantic -Wno-unused %s
+// RUN: %clang_cc1 -verify=c89-23 -std=c89 -Wall -pedantic -Wno-unused
-Wno-comment %s
-/* WG14 N3410: No
+/* WG14 N3410: Clang 23
* Slay Some Earthly Demons XI
*
* It is now ill-formed for the same identifier within a TU to have both
* internal and external linkage.
*/
-void func1() {
- extern int a; // #a
+void func1(void) {
+ extern int a; /* #a */
}
-// This 'a' is the same as the one declared extern above.
-static int a; /* expected-error {{static declaration of 'a' follows non-static
declaration}}
- expected-note@#a {{previous declaration is here}}
+/* This 'a' is the same as the one declared extern above. */
+static int a; /* c2y-error {{static declaration of 'a' follows non-static
declaration}}
+ c2y-note@#a {{previous declaration is here}}
+ c89-23-error {{static declaration of 'a' follows non-static
declaration}}
----------------
AaronBallman wrote:
```suggestion
c89-23-error {{static declaration of 'a' follows non-static
declaration; behavior is undefined}}
```
https://github.com/llvm/llvm-project/pull/193567
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits