summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/has_attribute.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2019-08-15 18:35:44 +0000
committerAaron Ballman <aaron@aaronballman.com>2019-08-15 18:35:44 +0000
commit2ed4573e8f8619dc67647256ac070bf91f461392 (patch)
tree4ebec17cb673b7f46a82af3d2c0af5a72885a1ec /clang/test/Preprocessor/has_attribute.cpp
parent00782a4b68c71b9fb80b403b13f9ec67f07a87a4 (diff)
downloadbcm5719-llvm-2ed4573e8f8619dc67647256ac070bf91f461392.tar.gz
bcm5719-llvm-2ed4573e8f8619dc67647256ac070bf91f461392.zip
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
Diffstat (limited to 'clang/test/Preprocessor/has_attribute.cpp')
-rw-r--r--clang/test/Preprocessor/has_attribute.cpp3
1 files changed, 3 insertions, 0 deletions
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__)
OpenPOWER on IntegriCloud