[clang] [clang] support Wold-style-declaration (PR #78837)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 20 12:01:00 PST 2024
================
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wold-style-declaration %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wextra %s
+
+static int x0;
+int __attribute__ ((aligned (16))) static x1; // expected-warning {{'static' is not at beginning of declaration}}
+
+extern int x2;
+int extern x3; // expected-warning {{'extern' is not at beginning of declaration}}
+
+typedef int x4;
+int typedef x5; // expected-warning {{'typedef' is not at beginning of declaration}}
+
+void g (int);
+
+void
+f (void)
+{
+ auto int x6 = 0;
+ int auto x7 = 0; // expected-warning {{'auto' is not at beginning of declaration}}
----------------
AaronBallman wrote:
This is going to cause problems when we update to `-std=c23`, so it might be good to guard this on `__STDC_VERSION__` to save ourselves some headaches later.
https://github.com/llvm/llvm-project/pull/78837
More information about the cfe-commits
mailing list