diff options
-rw-r--r-- | clang/include/clang/Parse/Parser.h | 2 | ||||
-rw-r--r-- | clang/test/SemaCXX/typo-correction.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h index 307446c3427..ba5c946d359 100644 --- a/clang/include/clang/Parse/Parser.h +++ b/clang/include/clang/Parse/Parser.h @@ -339,7 +339,7 @@ private: void UnconsumeToken(Token &Consumed) { Token Next = Tok; PP.EnterToken(Consumed); - ConsumeToken(); + PP.Lex(Tok); PP.EnterToken(Next); } diff --git a/clang/test/SemaCXX/typo-correction.cpp b/clang/test/SemaCXX/typo-correction.cpp index 4f1928365f8..3b31b8db798 100644 --- a/clang/test/SemaCXX/typo-correction.cpp +++ b/clang/test/SemaCXX/typo-correction.cpp @@ -4,6 +4,11 @@ // afoul the hard-coded limit (escape hatch) of 20 different typos whose // correction was attempted by Sema::CorrectTypo +namespace PR21817{ +int a(-rsing[2]); // expected-error {{undeclared identifier 'rsing'; did you mean 'using'?}} + // expected-error@-1 {{expected expression}} +} + struct errc { int v_; operator int() const {return v_;} |