[clang] [clang] support Wold-style-declaration (PR #78837)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 20 12:02:59 PST 2024


================
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wold-style-declaration %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wextra %s
+
----------------
AaronBallman wrote:

It would be good to add a RUN line along these lines:
```suggestion
// RUN: %clang_cc1 -fsyntax-only -verify -Wextra %s
// RUN: %clang_cc1 -fsyntax-only -verify=cpp -Wextra -x c++ %s

// cpp-no-diagnostics
```
and group the code that's invalid in C++ under `#ifndef __cplusplus`, to show that the diagnostics are not generated in C++, only in C.

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


More information about the cfe-commits mailing list