[clang] [clang] Add test for CWG3088 about macros defining special identifiers (PR #189309)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 30 07:15:03 PDT 2026
================
@@ -0,0 +1,270 @@
+// RUN: %clang_cc1 -std=c++98 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected
+// RUN: %clang_cc1 -std=c++11 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx11
+// RUN: %clang_cc1 -std=c++14 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx11
+// RUN: %clang_cc1 -std=c++17 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx11
+// RUN: %clang_cc1 -std=c++20 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx11,since-cxx20
+// RUN: %clang_cc1 -std=c++23 -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx11,since-cxx20
+// RUN: %clang_cc1 -std=c++2c -fexceptions -fcxx-exceptions -pedantic-errors %s -verify-directives -verify=expected,since-cxx11,since-cxx20
+
+namespace cwg3088 { // cwg3088: partial
+#define asm
----------------
Endilll wrote:
I added function-like macro tests. Diagnostics for them follow object-like tests, except for `char16_t`, i.e. we diagnose almost all keywords, identifiers with special meaning and alternative spellings, but not attributes, when they are used as a macro name of an function-like macro.
https://github.com/llvm/llvm-project/pull/189309
More information about the cfe-commits
mailing list