summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/TokenLexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-17 16:24:30 +0000
committerChris Lattner <sabre@nondot.org>2010-07-17 16:24:30 +0000
commit52c00bdd5ba734e6cb3eea33d7e0657f1b751b77 (patch)
tree55974288230f316100b928ef6a29c2180b5dd2ff /clang/lib/Lex/TokenLexer.cpp
parentb2c4937ee49600148e97c03fe31e70533cdbc00b (diff)
downloadbcm5719-llvm-52c00bdd5ba734e6cb3eea33d7e0657f1b751b77.tar.gz
bcm5719-llvm-52c00bdd5ba734e6cb3eea33d7e0657f1b751b77.zip
Add another terrible VC++ compatibility hack: allow users to
allow invalid token pastes (when in -fms-extensions mode) with -Wno-invalid-token-paste llvm-svn: 108624
Diffstat (limited to 'clang/lib/Lex/TokenLexer.cpp')
-rw-r--r--clang/lib/Lex/TokenLexer.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Lex/TokenLexer.cpp b/clang/lib/Lex/TokenLexer.cpp
index 56bb073e591..55609492a7f 100644
--- a/clang/lib/Lex/TokenLexer.cpp
+++ b/clang/lib/Lex/TokenLexer.cpp
@@ -478,7 +478,7 @@ bool TokenLexer::PasteTokens(Token &Tok) {
return true;
}
- // Do not emit the warning when preprocessing assembler code.
+ // Do not emit the error when preprocessing assembler code.
if (!PP.getLangOptions().AsmPreprocessor) {
// Explicitly convert the token location to have proper instantiation
// information so that the user knows where it came from.
@@ -486,7 +486,12 @@ bool TokenLexer::PasteTokens(Token &Tok) {
SourceLocation Loc =
SM.createInstantiationLoc(PasteOpLoc, InstantiateLocStart,
InstantiateLocEnd, 2);
- PP.Diag(Loc, diag::err_pp_bad_paste)
+ // If we're in microsoft extensions mode, downgrade this from a hard
+ // error to a warning that defaults to an error. This allows
+ // disabling it.
+ PP.Diag(Loc,
+ PP.getLangOptions().Microsoft ? diag::err_pp_bad_paste_ms
+ : diag::err_pp_bad_paste)
<< std::string(Buffer.begin(), Buffer.end());
}
OpenPOWER on IntegriCloud