forked from OSchip/llvm-project
Parse: Don't reorder tokens using ConsumeToken
ConsumeToken doesn't work with special tokens. Instead, just use PP.Lex to eat the token. This fixes PR21817. llvm-svn: 224232
This commit is contained in:
parent
a47ae907e8
commit
ecabbc52d5
|
@ -339,7 +339,7 @@ private:
|
|||
void UnconsumeToken(Token &Consumed) {
|
||||
Token Next = Tok;
|
||||
PP.EnterToken(Consumed);
|
||||
ConsumeToken();
|
||||
PP.Lex(Tok);
|
||||
PP.EnterToken(Next);
|
||||
}
|
||||
|
||||
|
|
|
@ -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_;}
|
||||
|
|
Loading…
Reference in New Issue