================
@@ -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
+// expected-error@-1 {{keyword is hidden by macro definition}}
+#define auto
+// expected-error@-1 {{keyword is hidden by macro definition}}
+#define bool
+// expected-error@-1 {{keyword is hidden by macro definition}}
+#define break
+// expected-error@-1 {{keyword is hidden by macro definition}}
+#define case
+// expected-error@-1 {{keyword is hidden by macro definition}}
+#define catch
+// expected-error@-1 {{keyword is hidden by macro definition}}
+#define char
+// expected-error@-1 {{keyword is hidden by macro definition}}
+#define class
+// expected-error@-1 {{keyword is hidden by macro definition}}
+#define const
+// FIXME-error@-1 {{keyword is hidden by macro definition}}
----------------
AaronBallman wrote:
Fixing this will break code, it is not rare for code to have a mode that does
something like `#define const` in one branch and `#define const const` in
another so you can control whether `const` is applied or not via a
configuration macro.
That's not to say "don't do it" but I would be opposed to fixing it as a DR. In
general, when a committee decides to knowingly break existing user code, I'd
rather we err on the side of making it harder for users to upgrade to that
standard version than making it harder for users to upgrade Clang itself.
https://github.com/llvm/llvm-project/pull/189309
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits