Disallow use of __has_c_attribute in C++ mode.
authorAaron Ballman <aaron@aaronballman.com>
Mon, 25 Nov 2019 22:32:07 +0000 (17:32 -0500)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 25 Nov 2019 22:35:12 +0000 (17:35 -0500)
commitd930ed1acc0ea49d4b3aae7e95b4c6d9cd310578
tree947d5557d14981c7e0a1bedea59cd88afab7b6df
parent214683f3b2d6f421c346debf41d545de18cc0caa
Disallow use of __has_c_attribute in C++ mode.

__has_cpp_attribute is not available in C mode, and __has_c_attribute
should not be available in C++ mode. This also adds a test to
demonstrate that we properly handle scoped attribute tokens even in C
mode.
clang/lib/Lex/PPMacroExpansion.cpp
clang/test/Preprocessor/has_c_attribute.c
clang/test/Preprocessor/has_c_attribute.cpp [new file with mode: 0644]