summaryrefslogtreecommitdiffstats
path: root/clang/test/Preprocessor/has_c_attribute.c
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_c_attribute.c
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_c_attribute.c')
-rw-r--r--clang/test/Preprocessor/has_c_attribute.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/has_c_attribute.c b/clang/test/Preprocessor/has_c_attribute.c
index dc22da7e4cd..843a67a2646 100644
--- a/clang/test/Preprocessor/has_c_attribute.c
+++ b/clang/test/Preprocessor/has_c_attribute.c
@@ -10,3 +10,7 @@
int does_not_have_selectany();
#endif
+// CHECK: has_nodiscard_underscore
+#if __has_c_attribute(__nodiscard__)
+ int has_nodiscard_underscore();
+#endif
OpenPOWER on IntegriCloud