aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Lex/LiteralSupport.cpp1
-rw-r--r--clang/test/Lexer/char-escapes-delimited.c2
-rw-r--r--clang/unittests/Lex/LexerTest.cpp8
3 files changed, 2 insertions, 9 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp
index 160240e..1a48a68 100644
--- a/clang/lib/Lex/LiteralSupport.cpp
+++ b/clang/lib/Lex/LiteralSupport.cpp
@@ -545,6 +545,7 @@ static bool ProcessNamedUCNEscape(const char *ThisTokBegin,
diag::err_delimited_escape_missing_brace)
<< StringRef(&ThisTokBuf[-1], 1);
}
+ ThisTokBuf++;
return false;
}
ThisTokBuf++;
diff --git a/clang/test/Lexer/char-escapes-delimited.c b/clang/test/Lexer/char-escapes-delimited.c
index 43ade65..65e3dc7 100644
--- a/clang/test/Lexer/char-escapes-delimited.c
+++ b/clang/test/Lexer/char-escapes-delimited.c
@@ -94,7 +94,7 @@ void named(void) {
unsigned h = U'\N{LOTUS}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}}
unsigned i = u'\N{GREEK CAPITAL LETTER DELTA}'; // ext-warning {{extension}} cxx2b-warning {{C++2b}}
- char j = '\NN'; // expected-error {{expected '{' after '\N' escape sequence}} expected-warning {{multi-character character constant}}
+ char j = '\NN'; // expected-error {{expected '{' after '\N' escape sequence}}
unsigned k = u'\N{LOTUS'; // expected-error {{incomplete universal character name}}
}
diff --git a/clang/unittests/Lex/LexerTest.cpp b/clang/unittests/Lex/LexerTest.cpp
index aefe5f1..0ad644c 100644
--- a/clang/unittests/Lex/LexerTest.cpp
+++ b/clang/unittests/Lex/LexerTest.cpp
@@ -18,7 +18,6 @@
#include "clang/Basic/TokenKinds.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/HeaderSearchOptions.h"
-#include "clang/Lex/LiteralSupport.h"
#include "clang/Lex/MacroArgs.h"
#include "clang/Lex/MacroInfo.h"
#include "clang/Lex/ModuleLoader.h"
@@ -660,11 +659,4 @@ TEST_F(LexerTest, RawAndNormalLexSameForLineComments) {
}
EXPECT_TRUE(ToksView.empty());
}
-
-TEST_F(LexerTest, BrokenStringLiteral) {
- const llvm::StringLiteral Source = R"cpp("\N")cpp";
- // Make sure this isn't crashing.
- StringLiteralParser P(Lex(Source), *PP);
- EXPECT_TRUE(P.hadError);
-}
} // anonymous namespace