Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -5063,6 +5063,15 @@ // Do special checking on direct calls to functions. if (FDecl) { + if (!getLangOpts().CPlusPlus) { + // C cannot handle TypoExpr nodes because it + // doesn't handle dependent types properly. + ExprResult Result = CorrectDelayedTyposInExpr(TheCall); + if (!Result.isUsable() || !isa(Result.get())) + return ExprError(); + TheCall = cast(Result.get()); + } + if (CheckFunctionCall(FDecl, TheCall, Proto)) return ExprError(); Index: test/Sema/typo-builtin-crash.c =================================================================== --- test/Sema/typo-builtin-crash.c +++ test/Sema/typo-builtin-crash.c @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +int main(void) +{ + fabs(a); // expected-error {{undeclared identifier 'a'}} \ + // expected-warning {{implicitly declaring library function 'fabs' with type 'double (double)'}} \ + // expected-warning {{include the header or explicitly provide a declaration for 'fabs'}} + return (0); +}