Commit db110b98 authored by Hans Wennborg's avatar Hans Wennborg
Browse files

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
------------------------------------------------------------------------

llvm-svn: 245615
parent a0e728bc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4949,6 +4949,7 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl,
    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.
+6 −0
Original line number Diff line number Diff line
@@ -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'?}}
}