forked from OSchip/llvm-project
Diagnose delayed typos in an expr list that is in an invalid expression.
Previously, if the expr list parsed fine but the expr to the left of the open parenthesis was invalid (when parsing the suffix of a postfix-expression), the parsed expr list was just ignored. Fixes PR23005. llvm-svn: 233347
This commit is contained in:
parent
821880a7a1
commit
92565b51aa
|
@ -1459,6 +1459,9 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
|
|||
})) {
|
||||
(void)Actions.CorrectDelayedTyposInExpr(LHS);
|
||||
LHS = ExprError();
|
||||
} else if (LHS.isInvalid()) {
|
||||
for (auto &E : ArgExprs)
|
||||
Actions.CorrectDelayedTyposInExpr(E);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,3 +193,8 @@ void f() {
|
|||
TimeTicks::now(); // expected-error {{no member named 'now' in 'PR22297::TimeTicks'; did you mean 'Now'?}}
|
||||
}
|
||||
}
|
||||
|
||||
namespace PR23005 {
|
||||
void f() { int a = Unknown::b(c); } // expected-error {{use of undeclared identifier 'Unknown'}}
|
||||
// expected-error@-1 {{use of undeclared identifier 'c'}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue