aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r--lib/Lex/Lexer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index b071a7525f..e6030ad1d4 100644
--- a/lib/Lex/Lexer.cpp
+++ b/lib/Lex/Lexer.cpp
@@ -777,9 +777,14 @@ bool Lexer::SkipBCPLComment(Token &Result, const char *CurPtr) {
break; // Found the newline? Break out!
// Otherwise, this is a hard case. Fall back on getAndAdvanceChar to
- // properly decode the character.
+ // properly decode the character. Read it in raw mode to avoid emitting
+ // diagnostics about things like trigraphs. If we see an escaped newline,
+ // we'll handle it below.
const char *OldPtr = CurPtr;
+ bool OldRawMode = isLexingRawMode();
+ LexingRawMode = true;
C = getAndAdvanceChar(CurPtr, Result);
+ LexingRawMode = OldRawMode;
// If we read multiple characters, and one of those characters was a \r or
// \n, then we had an escaped newline within the comment. Emit diagnostic