Handle delayed corrections in a couple more error paths in ParsePostfixExpressionSuffix.
authorKaelyn Takata <rikka@google.com>
Wed, 3 Dec 2014 05:30:54 +0000 (05:30 +0000)
committerKaelyn Takata <rikka@google.com>
Wed, 3 Dec 2014 05:30:54 +0000 (05:30 +0000)
llvm-svn: 223209

clang/lib/Parse/ParseExpr.cpp
clang/test/SemaCXX/typo-correction-delayed.cpp

index eeea15d..ee8f4d9 100644 (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();
           }
         }
index 7bf9258..f7ef015 100644 (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}}
+}