From 240324b73a1e11a1e24a1451b7c7d3dba5d8a5af Mon Sep 17 00:00:00 2001 From: Kaelyn Takata Date: Wed, 3 Dec 2014 05:30:54 +0000 Subject: [PATCH] Handle delayed corrections in a couple more error paths in ParsePostfixExpressionSuffix. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223209 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Parse/ParseExpr.cpp | 2 ++ test/SemaCXX/typo-correction-delayed.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index eeea15dec0..ee8f4d9af6 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -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(); } } diff --git a/test/SemaCXX/typo-correction-delayed.cpp b/test/SemaCXX/typo-correction-delayed.cpp index 7bf925816d..f7ef01542e 100644 --- a/test/SemaCXX/typo-correction-delayed.cpp +++ b/test/SemaCXX/typo-correction-delayed.cpp @@ -106,3 +106,9 @@ void f(int *i) { const int DefaultArg = 9; // expected-note {{'DefaultArg' declared here}} template 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}} +} -- 2.40.0