diff options
author | Andy Gibbs <andyg1001@hotmail.co.uk> | 2016-04-01 19:02:20 +0000 |
---|---|---|
committer | Andy Gibbs <andyg1001@hotmail.co.uk> | 2016-04-01 19:02:20 +0000 |
commit | 6f8cfccbd36de601b6f35a854cb0dba5b9757495 (patch) | |
tree | 4d424e7ba66e2fa8707033736822d609e9efefcb /clang/lib | |
parent | dd711b93e0bc525119ef82e4647d2a096ddb624e (diff) | |
download | bcm5719-llvm-6f8cfccbd36de601b6f35a854cb0dba5b9757495.tar.gz bcm5719-llvm-6f8cfccbd36de601b6f35a854cb0dba5b9757495.zip |
Diagnose missing macro argument following charize operator.
For completeness, add a test-case for the equivalent stringize operator
diagnostic too.
llvm-svn: 265177
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index c36670ca635..dc1f32fb569 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -2151,7 +2151,7 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok, while (Tok.isNot(tok::eod)) { LastTok = Tok; - if (Tok.isNot(tok::hash) && Tok.isNot(tok::hashhash)) { + if (!Tok.isOneOf(tok::hash, tok::hashat, tok::hashhash)) { MI->AddTokenToBody(Tok); // Get the next token of the macro. @@ -2210,7 +2210,8 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok, MI->AddTokenToBody(LastTok); continue; } else { - Diag(Tok, diag::err_pp_stringize_not_parameter); + Diag(Tok, diag::err_pp_stringize_not_parameter) + << LastTok.is(tok::hashat); // Disable __VA_ARGS__ again. Ident__VA_ARGS__->setIsPoisoned(true); |