summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-12-28 07:42:49 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-12-28 07:42:49 +0000
commitf2d3bc047406f811c2942de9cd3d84bc4b6c8f54 (patch)
tree9b279a0b21004d4b8c1544a0b531629d027f2741 /clang/lib/Lex/PPDirectives.cpp
parenta894e9e070e10c54e4a012bd5f93eafedf050ff9 (diff)
downloadbcm5719-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.cpp3
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:
OpenPOWER on IntegriCloud