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

Kaelyn Takata rikka at google.com
Tue Dec 2 21:30:54 PST 2014


Author: rikka
Date: Tue Dec  2 23:30:54 2014
New Revision: 223209

URL: http://llvm.org/viewvc/llvm-project?rev=223209&view=rev
Log:
Handle delayed corrections in a couple more error paths in ParsePostfixExpressionSuffix.

Modified:
    cfe/trunk/lib/Parse/ParseExpr.cpp
    cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp

Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=223209&r1=223208&r2=223209&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Tue Dec  2 23:30:54 2014
@@ -1390,6 +1390,7 @@ Parser::ParsePostfixExpressionSuffix(Exp
         SourceLocation OpenLoc = ConsumeToken();
 
         if (ParseSimpleExpressionList(ExecConfigExprs, ExecConfigCommaLocs)) {
+          (void)Actions.CorrectDelayedTyposInExpr(LHS);
           LHS = ExprError();
         }
 
@@ -1440,6 +1441,7 @@ Parser::ParsePostfixExpressionSuffix(Exp
         if (Tok.isNot(tok::r_paren)) {
           if (ParseExpressionList(ArgExprs, CommaLocs, &Sema::CodeCompleteCall,
                                   LHS.get())) {
+            (void)Actions.CorrectDelayedTyposInExpr(LHS);
             LHS = ExprError();
           }
         }

Modified: cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp?rev=223209&r1=223208&r2=223209&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp (original)
+++ cfe/trunk/test/SemaCXX/typo-correction-delayed.cpp Tue Dec  2 23:30:54 2014
@@ -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}}
+}





More information about the cfe-commits mailing list