diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 4 | ||||
-rw-r--r-- | clang/test/Preprocessor/has_attribute.c | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 06f14c24bdd..d21515c5a64 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -1218,9 +1218,7 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { if (Tok.is(tok::l_paren)) { // Read the identifier LexUnexpandedToken(Tok); - if (Tok.is(tok::identifier) || Tok.is(tok::kw_const)) { - FeatureII = Tok.getIdentifierInfo(); - + if ((FeatureII = Tok.getIdentifierInfo())) { // Read the ')'. LexUnexpandedToken(Tok); if (Tok.is(tok::r_paren)) diff --git a/clang/test/Preprocessor/has_attribute.c b/clang/test/Preprocessor/has_attribute.c index 711cf671cfe..555c2b3f9e2 100644 --- a/clang/test/Preprocessor/has_attribute.c +++ b/clang/test/Preprocessor/has_attribute.c @@ -34,3 +34,7 @@ int has_something_we_dont_have(); static int constFunction() __attribute__((const)); #endif +// CHECK: has_no_volatile_attribute +#if !__has_attribute(volatile) +int has_no_volatile_attribute(); +#endif |