Index: Sema/Sema.cpp =================================================================== --- Sema/Sema.cpp +++ Sema/Sema.cpp @@ -1688,7 +1688,8 @@ QT, OpenCLTypeExtMap); } -bool Sema::checkOpenCLDisabledDecl(const Decl &D, const Expr &E) { - return checkOpenCLDisabledTypeOrDecl(&D, E.getLocStart(), "", +bool Sema::checkOpenCLDisabledDecl(const FunctionDecl &D, const Expr &E) { + IdentifierInfo *FnName = D.getIdentifier(); + return checkOpenCLDisabledTypeOrDecl(&D, E.getLocStart(), FnName, OpenCLDeclExtMap, 1, D.getSourceRange()); } Index: SemaOpenCL/extension-begin.cl =================================================================== --- SemaOpenCL/extension-begin.cl +++ SemaOpenCL/extension-begin.cl @@ -46,7 +46,7 @@ const struct A test_A_local; // expected-error {{use of type 'struct A' requires my_ext extension to be enabled}} TypedefOfA test_typedef_A; // expected-error {{use of type 'TypedefOfA' (aka 'struct A') requires my_ext extension to be enabled}} PointerOfA test_A_pointer; // expected-error {{use of type 'PointerOfA' (aka 'const struct A *') requires my_ext extension to be enabled}} - f(); // expected-error {{use of declaration requires my_ext extension to be enabled}} + f(); // expected-error {{use of declaration 'f' requires my_ext extension to be enabled}} g(0); // expected-error {{no matching function for call to 'g'}} // expected-note@-26 {{candidate disabled due to OpenCL extension}} // expected-note@-22 {{candidate function not viable: requires 0 arguments, but 1 was provided}} Index: clang/Basic/DiagnosticSemaKinds.td =================================================================== --- clang/Basic/DiagnosticSemaKinds.td +++ clang/Basic/DiagnosticSemaKinds.td @@ -8404,7 +8404,7 @@ def err_opencl_variadic_function : Error< "invalid prototype, variadic arguments are not allowed in OpenCL">; def err_opencl_requires_extension : Error< - "use of %select{type |declaration}0%1 requires %2 extension to be enabled">; + "use of %select{type|declaration}0 %1 requires %2 extension to be enabled">; // OpenCL v2.0 s6.13.6 -- Builtin Pipe Functions def err_opencl_builtin_pipe_first_arg : Error< Index: clang/Sema/Sema.h =================================================================== --- clang/Sema/Sema.h +++ clang/Sema/Sema.h @@ -8432,7 +8432,7 @@ /// is disabled due to required OpenCL extensions being disabled. If so, /// emit diagnostics. /// \return true if type is disabled. - bool checkOpenCLDisabledDecl(const Decl &D, const Expr &E); + bool checkOpenCLDisabledDecl(const FunctionDecl &D, const Expr &E); //===--------------------------------------------------------------------===// // OpenMP directives and clauses.