[clang] [Clang] disallow # operators in attribute argument lists (PR #147308)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 30 06:25:34 PDT 2025
================
@@ -124,6 +124,11 @@ Improvements to Clang's diagnostics
Added a new warning in this group for the case where the attribute is missing/implicit on
an override of a virtual method.
+- Clang rejects the ``#`` and ``##`` preprocessor tokens in an attribute
+ argument list in C++. The operators can be used in macro replacement lists
+ with the usual preprocessor semantics. What is rejected are non-preprocessor
----------------
erichkeane wrote:
```suggestion
with the usual preprocessor semantics, however non-preprocessor use of tokens are now rejected in C++. Compilation in C mode is unchanged, and still permits these tokens to be used.
```
https://github.com/llvm/llvm-project/pull/147308
More information about the cfe-commits
mailing list