Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -5050,7 +5050,10 @@ for (QualType ParamType : FT->param_types()) { // Convert array arguments to pointer to simplify type lookup. - Expr *Arg = Sema->DefaultFunctionArrayLvalueConversion(ArgExprs[i++]).get(); + ExprResult R = Sema->DefaultFunctionArrayLvalueConversion(ArgExprs[i++]); + if (R.isInvalid()) + continue; + Expr *Arg = R.get(); QualType ArgType = Arg->getType(); if (!ParamType->isPointerType() || ParamType.getQualifiers().hasAddressSpace() || Index: test/Sema/implicit-function-typo-crash.c =================================================================== --- /dev/null +++ test/Sema/implicit-function-typo-crash.c @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +// PR25961 +void free(); // expected-note {{'free' declared here}} +int main() { + strcpy(file, 0); // expected-warning {{implicitly declaring library function 'strcpy' with type}} \ + // expected-note {{include the header }} \ + // expected-error {{use of undeclared identifier 'file'; did you mean 'free'}} +}