summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorAndy Gibbs <andyg1001@hotmail.co.uk>2012-11-17 19:16:52 +0000
committerAndy Gibbs <andyg1001@hotmail.co.uk>2012-11-17 19:16:52 +0000
commita8df57a962ff5ccd340aff234215738a64c4c735 (patch)
treee73663742d4f0a8b29db51505cd8b0d1403f8a54 /clang/lib/Lex/Preprocessor.cpp
parent58905d251bc053ea836183080c7b0a11577c0fb0 (diff)
downloadbcm5719-llvm-a8df57a962ff5ccd340aff234215738a64c4c735.tar.gz
bcm5719-llvm-a8df57a962ff5ccd340aff234215738a64c4c735.zip
Made the "expected string literal" diagnostic more expressive
llvm-svn: 168267
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 52d6bb6a83b..94885841057 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -691,10 +691,12 @@ void Preprocessor::LexAfterModuleImport(Token &Result) {
}
bool Preprocessor::FinishLexStringLiteral(Token &Result, std::string &String,
+ const char *DiagnosticTag,
bool AllowMacroExpansion) {
// We need at least one string literal.
if (Result.isNot(tok::string_literal)) {
- Diag(Result, diag::err_expected_string_literal);
+ Diag(Result, diag::err_expected_string_literal)
+ << /*Source='in...'*/0 << DiagnosticTag;
return false;
}
@@ -720,7 +722,8 @@ bool Preprocessor::FinishLexStringLiteral(Token &Result, std::string &String,
return false;
if (Literal.Pascal) {
- Diag(StrToks[0].getLocation(), diag::err_expected_string_literal);
+ Diag(StrToks[0].getLocation(), diag::err_expected_string_literal)
+ << /*Source='in...'*/0 << DiagnosticTag;
return false;
}
OpenPOWER on IntegriCloud