------------------------------------------------------------------------
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
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_37@245615
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
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'?}}
+}