[llvm-branch-commits] [cfe-branch] r226635 - Merging r226624:

Hans Wennborg hans at hanshq.net
Tue Jan 20 17:49:01 PST 2015


Author: hans
Date: Tue Jan 20 19:49:01 2015
New Revision: 226635

URL: http://llvm.org/viewvc/llvm-project?rev=226635&view=rev
Log:
Merging r226624:
------------------------------------------------------------------------
r226624 | rikka | 2015-01-20 16:04:19 -0800 (Tue, 20 Jan 2015) | 6 lines

Correct all typos in the initialization arguments, even if one could not
be corrected.

This fixes PR22250, which exposed the bug where if there's more than one
TypoExpr in the arguments, once one failed to be corrected none of the
TypoExprs after it would be handled at all thanks to an early return.
------------------------------------------------------------------------

Modified:
    cfe/branches/release_36/   (props changed)
    cfe/branches/release_36/lib/Sema/SemaDecl.cpp
    cfe/branches/release_36/test/SemaCXX/typo-correction-delayed.cpp

Propchange: cfe/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 20 19:49:01 2015
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:226008,226049,226136,226282
+/cfe/trunk:226008,226049,226136,226282,226624
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_36/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/lib/Sema/SemaDecl.cpp?rev=226635&r1=226634&r2=226635&view=diff
==============================================================================
--- cfe/branches/release_36/lib/Sema/SemaDecl.cpp (original)
+++ cfe/branches/release_36/lib/Sema/SemaDecl.cpp Tue Jan 20 19:49:01 2015
@@ -8828,11 +8828,12 @@ void Sema::AddInitializerToDecl(Decl *Re
           });
       if (Res.isInvalid()) {
         VDecl->setInvalidDecl();
-        return;
-      }
-      if (Res.get() != Args[Idx])
+      } else if (Res.get() != Args[Idx]) {
         Args[Idx] = Res.get();
+      }
     }
+    if (VDecl->isInvalidDecl())
+      return;
 
     InitializationSequence InitSeq(*this, Entity, Kind, Args);
     ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Args, &DclT);

Modified: cfe/branches/release_36/test/SemaCXX/typo-correction-delayed.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/test/SemaCXX/typo-correction-delayed.cpp?rev=226635&r1=226634&r2=226635&view=diff
==============================================================================
--- cfe/branches/release_36/test/SemaCXX/typo-correction-delayed.cpp (original)
+++ cfe/branches/release_36/test/SemaCXX/typo-correction-delayed.cpp Tue Jan 20 19:49:01 2015
@@ -157,3 +157,11 @@ namespace PR22092 {
 a = b ? : 0;  // expected-error {{C++ requires a type specifier for all declarations}} \
               // expected-error-re {{use of undeclared identifier 'b'{{$}}}}
 }
+
+namespace PR22250 {
+// expected-error at +4 {{use of undeclared identifier 'size_t'; did you mean 'sizeof'?}}
+// expected-error-re at +3 {{use of undeclared identifier 'y'{{$}}}}
+// expected-error-re at +2 {{use of undeclared identifier 'z'{{$}}}}
+// expected-error at +1 {{expected ';' after top level declarator}}
+int getenv_s(size_t *y, char(&z)) {}
+}





More information about the llvm-branch-commits mailing list