Index: lib/Sema/SemaLookup.cpp =================================================================== --- lib/Sema/SemaLookup.cpp +++ lib/Sema/SemaLookup.cpp @@ -690,6 +690,16 @@ S.Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) return false; + // OpenCL v1.2 s6.9.f: + // The library functions defined in the C99 standard headers assert.h, + // ctype.h, complex.h, errno.h, fenv.h, float.h, inttypes.h, limits.h, + // locale.h, setjmp.h, signal.h, stdarg.h, stdio.h, stdlib.h, string.h, + // tgmath.h, time.h, wchar.h and wctype.h are not available and cannot + // be included by a program. + if (S.getLangOpts().OpenCL && + S.Context.BuiltinInfo.isPredefinedLibFunction(BuiltinID)) + return false; + if (NamedDecl *D = S.LazilyCreateBuiltin((IdentifierInfo *)II, BuiltinID, S.TUScope, R.isForRedeclaration(), Index: test/SemaOpenCL/builtin.cl =================================================================== --- /dev/null +++ test/SemaOpenCL/builtin.cl @@ -0,0 +1,3 @@ +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only + +float __attribute__((overloadable)) acos(float); // expected-no-diagnostics