[llvm-branch-commits] [cfe-branch] r245615 - Merging r245560:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 20 14:09:20 PDT 2015


Author: hans
Date: Thu Aug 20 16:09:20 2015
New Revision: 245615

URL: http://llvm.org/viewvc/llvm-project?rev=245615&view=rev
Log:
Merging r245560:
------------------------------------------------------------------------
r245560 | ogoffart | 2015-08-20 06:11:14 -0700 (Thu, 20 Aug 2015) | 5 lines

Fix crash with two typos in the arguments of a function

The problem is that the arguments are of TheCall are reset later
to the ones in Args, making TypoExpr put back. Some TypoExpr that have
already  been diagnosed and will assert later in Sema::getTypoExprState
------------------------------------------------------------------------

Modified:
    cfe/branches/release_37/   (props changed)
    cfe/branches/release_37/lib/Sema/SemaExpr.cpp
    cfe/branches/release_37/test/Sema/typo-correction.c

Propchange: cfe/branches/release_37/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 20 16:09:20 2015
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:242244,242285,242293,242297,242313,242382,242422,242499,242574,242600,242660,242662,242667,242678,242766,242854,242905,242973,243018,243048,243085,243098,243101,243105,243133,243144,243153,243196,243206,243277,243280,243285,243289,243343,243417,243463,243538,243594,243642-243644,243851,243945-243950,243964,244000,244193,244266,244468,244488,244502,244719,244794,244902,245041,245084,245259
+/cfe/trunk:242244,242285,242293,242297,242313,242382,242422,242499,242574,242600,242660,242662,242667,242678,242766,242854,242905,242973,243018,243048,243085,243098,243101,243105,243133,243144,243153,243196,243206,243277,243280,243285,243289,243343,243417,243463,243538,243594,243642-243644,243851,243945-243950,243964,244000,244193,244266,244468,244488,244502,244719,244794,244902,245041,245084,245259,245560
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_37/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/lib/Sema/SemaExpr.cpp?rev=245615&r1=245614&r2=245615&view=diff
==============================================================================
--- cfe/branches/release_37/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/release_37/lib/Sema/SemaExpr.cpp Thu Aug 20 16:09:20 2015
@@ -4949,6 +4949,7 @@ Sema::BuildResolvedCallExpr(Expr *Fn, Na
     if (!Result.isUsable()) return ExprError();
     TheCall = dyn_cast<CallExpr>(Result.get());
     if (!TheCall) return Result;
+    Args = ArrayRef<Expr *>(TheCall->getArgs(), TheCall->getNumArgs());
   }
 
   // Bail out early if calling a builtin with custom typechecking.

Modified: cfe/branches/release_37/test/Sema/typo-correction.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/test/Sema/typo-correction.c?rev=245615&r1=245614&r2=245615&view=diff
==============================================================================
--- cfe/branches/release_37/test/Sema/typo-correction.c (original)
+++ cfe/branches/release_37/test/Sema/typo-correction.c Thu Aug 20 16:09:20 2015
@@ -49,3 +49,9 @@ extern double cabs(_Complex double z);
 void fn1() {
   cabs(errij);  // expected-error {{use of undeclared identifier 'errij'}}
 }
+
+extern long afunction(int); // expected-note {{'afunction' declared here}}
+void fn2() {
+  f(THIS_IS_AN_ERROR, // expected-error {{use of undeclared identifier 'THIS_IS_AN_ERROR'}}
+    afunction(afunction_));  // expected-error {{use of undeclared identifier 'afunction_'; did you mean 'afunction'?}}
+}




More information about the llvm-branch-commits mailing list