From 2ed4573e8f8619dc67647256ac070bf91f461392 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 15 Aug 2019 18:35:44 +0000 Subject: Allow standards-based attributes to have leading and trailing underscores. This gives library implementers a way to use standards-based attributes that do not conflict with user-defined macros of the same name. Attributes in C2x require this behavior normatively (C2x 6.7.11p4), but there's no reason to not have the same behavior in C++, especially given that such attributes may be used by a C library consumed by a C++ compilation. llvm-svn: 369033 --- clang/test/Preprocessor/has_attribute.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/test/Preprocessor/has_attribute.cpp') diff --git a/clang/test/Preprocessor/has_attribute.cpp b/clang/test/Preprocessor/has_attribute.cpp index 83ee0e3c6cf..e7303c7c5b4 100644 --- a/clang/test/Preprocessor/has_attribute.cpp +++ b/clang/test/Preprocessor/has_attribute.cpp @@ -31,6 +31,9 @@ __clang__::fallthrough: __has_cpp_attribute(__clang__::fallthrough) // CHECK: _Clang::fallthrough: 201603L CXX11(_Clang::fallthrough) +// CHECK: __nodiscard__: 201907L +CXX11(__nodiscard__) + // CHECK: __gnu__::__const__: 1 CXX11(__gnu__::__const__) -- cgit v1.2.3