aboutsummaryrefslogtreecommitdiff
path: root/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
commit97f8461a2c553f68a258612d2322e4281c3f0915 (patch)
tree6b5036827ca26138a9cd9dd548c56c3246f1b3b6 /lib/Lex/Preprocessor.cpp
parent02a176871d91bba3004e4f94b2d4d588ae4b2122 (diff)
Made the "expected string literal" diagnostic more expressive
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r--lib/Lex/Preprocessor.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index 52d6bb6a83..9488584105 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/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;
}