ConsumeToken doesn't work with special tokens. Instead, just use PP.Lex
to eat the token.
This fixes PR21817.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224232
91177308-0d34-0410-b5e6-
96231b3b80d8
void UnconsumeToken(Token &Consumed) {
Token Next = Tok;
PP.EnterToken(Consumed);
- ConsumeToken();
+ PP.Lex(Tok);
PP.EnterToken(Next);
}
// 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_;}