Handle delayed corrections in a couple more error paths in ParsePostfixExpressionSuffix.

llvm-svn: 223209
This commit is contained in:
Kaelyn Takata 2014-12-03 05:30:54 +00:00
parent 120a0c92f4
commit 53ac6a04eb
2 changed files with 8 additions and 0 deletions

View File

@ -1390,6 +1390,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
SourceLocation OpenLoc = ConsumeToken();
if (ParseSimpleExpressionList(ExecConfigExprs, ExecConfigCommaLocs)) {
(void)Actions.CorrectDelayedTyposInExpr(LHS);
LHS = ExprError();
}
@ -1440,6 +1441,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
if (Tok.isNot(tok::r_paren)) {
if (ParseExpressionList(ArgExprs, CommaLocs, &Sema::CodeCompleteCall,
LHS.get())) {
(void)Actions.CorrectDelayedTyposInExpr(LHS);
LHS = ExprError();
}
}

View File

@ -106,3 +106,9 @@ void f(int *i) {
const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}}
template <int I = defaultArg> struct S {}; // expected-error {{use of undeclared identifier 'defaultArg'; did you mean 'DefaultArg'?}}
S<1> s;
namespace foo {}
void test_paren_suffix() {
foo::bar({5, 6}); // expected-error-re {{no member named 'bar' in namespace 'foo'{{$}}}} \
// expected-error {{expected expression}}
}