diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-12-28 07:42:49 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-12-28 07:42:49 +0000 |
commit | f2d3bc047406f811c2942de9cd3d84bc4b6c8f54 (patch) | |
tree | 9b279a0b21004d4b8c1544a0b531629d027f2741 /clang/lib/Lex/PPDirectives.cpp | |
parent | a894e9e070e10c54e4a012bd5f93eafedf050ff9 (diff) | |
download | bcm5719-llvm-f2d3bc047406f811c2942de9cd3d84bc4b6c8f54.tar.gz bcm5719-llvm-f2d3bc047406f811c2942de9cd3d84bc4b6c8f54.zip |
Lex: Don't let annotation tokens get into macro expansion
We'd let annotation tokens from '#pragma pack' and the like get inside a
function-like macro. This would lead to terror and mayhem; stop the
madness early.
This fixes PR22037.
llvm-svn: 224896
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r-- | clang/lib/Lex/PPDirectives.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 8f610b4e5d3..bf0ce72f666 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -798,7 +798,8 @@ void Preprocessor::HandleDirective(Token &Result) { case tok::pp_import: case tok::pp_include_next: case tok::pp___include_macros: - Diag(Result, diag::err_embedded_include) << II->getName(); + case tok::pp_pragma: + Diag(Result, diag::err_embedded_directive) << II->getName(); DiscardUntilEndOfDirective(); return; default: |