Index: cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td =================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td +++ cfe/trunk/include/clang/Basic/DiagnosticCommonKinds.td @@ -132,8 +132,8 @@ // OpenCL Section 6.8.g def err_opencl_unknown_type_specifier : Error< - "OpenCL %select{C|C++}0 version %1 does not support the '%2' " - "%select{type qualifier|storage class specifier}3">; + "%select{OpenCL C|C++ for OpenCL}0 version %1 does not support the " + "'%2' %select{type qualifier|storage class specifier}3">; def warn_unknown_attribute_ignored : Warning< "unknown attribute %0 ignored">, InGroup; @@ -291,9 +291,9 @@ def warn_arcmt_nsalloc_realloc : Warning<"[rewriter] call returns pointer to GC managed memory; it will become unmanaged in ARC">; def err_arcmt_nsinvocation_ownership : Error<"NSInvocation's %0 is not safe to be used with an object with ownership other than __unsafe_unretained">; -// OpenCL C++. +// C++ for OpenCL. def err_openclcxx_not_supported : Error< - "'%0' is not supported in OpenCL C++">; + "'%0' is not supported in C++ for OpenCL">; // OpenMP def err_omp_more_one_clause : Error< Index: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td =================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td +++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td @@ -1154,9 +1154,9 @@ def err_opencl_logical_exclusive_or : Error< "^^ is a reserved operator in OpenCL">; -// OpenCL C++. +// C++ for OpenCL. def err_openclcxx_virtual_function : Error< - "virtual functions are not supported in OpenCL C++">; + "virtual functions are not supported in C++ for OpenCL">; // OpenMP support. def warn_pragma_omp_ignored : Warning< Index: cfe/trunk/include/clang/Basic/LangOptions.def =================================================================== --- cfe/trunk/include/clang/Basic/LangOptions.def +++ cfe/trunk/include/clang/Basic/LangOptions.def @@ -197,8 +197,8 @@ LANGOPT(OpenCL , 1, 0, "OpenCL") LANGOPT(OpenCLVersion , 32, 0, "OpenCL C version") -LANGOPT(OpenCLCPlusPlus , 1, 0, "OpenCL C++") -LANGOPT(OpenCLCPlusPlusVersion , 32, 0, "OpenCL C++ version") +LANGOPT(OpenCLCPlusPlus , 1, 0, "C++ for OpenCL") +LANGOPT(OpenCLCPlusPlusVersion , 32, 0, "C++ for OpenCL version") LANGOPT(NativeHalfType , 1, 0, "Native half type support") LANGOPT(NativeHalfArgsAndReturns, 1, 0, "Native half args and returns") LANGOPT(HalfArgsAndReturns, 1, 0, "half args and returns") Index: cfe/trunk/include/clang/Basic/TokenKinds.def =================================================================== --- cfe/trunk/include/clang/Basic/TokenKinds.def +++ cfe/trunk/include/clang/Basic/TokenKinds.def @@ -252,9 +252,8 @@ // KEYNOMS18 - This is a keyword that must never be enabled under // MSVC <= v18. // KEYOPENCLC - This is a keyword in OpenCL C -// KEYOPENCLCXX - This is a keyword in OpenCL C++ -// KEYNOOPENCL - This is a keyword that is not supported in OpenCL C -// nor in OpenCL C++. +// KEYOPENCLCXX - This is a keyword in C++ for OpenCL +// KEYNOOPENCL - This is a keyword that is not supported in OpenCL // KEYALTIVEC - This is a keyword in AltiVec // KEYZVECTOR - This is a keyword for the System z vector extensions, // which are heavily based on AltiVec Index: cfe/trunk/include/clang/Frontend/LangStandards.def =================================================================== --- cfe/trunk/include/clang/Frontend/LangStandards.def +++ cfe/trunk/include/clang/Frontend/LangStandards.def @@ -166,7 +166,7 @@ OpenCL, "OpenCL 2.0", LineComment | C99 | Digraphs | HexFloat | OpenCL) LANGSTANDARD(openclcpp, "c++", - OpenCL, "OpenCL C++ 1.0", + OpenCL, "C++ for OpenCL", LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 | Digraphs | HexFloat | OpenCL) Index: cfe/trunk/lib/Frontend/InitPreprocessor.cpp =================================================================== --- cfe/trunk/lib/Frontend/InitPreprocessor.cpp +++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp @@ -411,7 +411,7 @@ if (LangOpts.OpenCLCPlusPlusVersion == 100) Builder.defineMacro("__OPENCL_CPP_VERSION__", "100"); else - llvm_unreachable("Unsupported OpenCL C++ version"); + llvm_unreachable("Unsupported C++ version for OpenCL"); Builder.defineMacro("__CL_CPP_VERSION_1_0__", "100"); } else { // OpenCL v1.0 and v1.1 do not have a predefined macro to indicate the Index: cfe/trunk/lib/Parse/ParseDecl.cpp =================================================================== --- cfe/trunk/lib/Parse/ParseDecl.cpp +++ cfe/trunk/lib/Parse/ParseDecl.cpp @@ -3559,7 +3559,8 @@ isInvalid = DS.setFunctionSpecInline(Loc, PrevSpec, DiagID); break; case tok::kw_virtual: - // OpenCL C++ v1.0 s2.9: the virtual function qualifier is not supported. + // C++ for OpenCL does not allow virtual function qualifier, to avoid + // function pointers restricted in OpenCL v2.0 s6.9.a. if (getLangOpts().OpenCLCPlusPlus) { DiagID = diag::err_openclcxx_virtual_function; PrevSpec = Tok.getIdentifierInfo()->getNameStart(); Index: cfe/trunk/lib/Sema/DeclSpec.cpp =================================================================== --- cfe/trunk/lib/Sema/DeclSpec.cpp +++ cfe/trunk/lib/Sema/DeclSpec.cpp @@ -596,7 +596,6 @@ // these storage-class specifiers. // OpenCL v1.2 s6.8 changes this to "The auto and register storage-class // specifiers are not supported." - // OpenCL C++ v1.0 s2.9 restricts register. if (S.getLangOpts().OpenCL && !S.getOpenCLOptions().isEnabled("cl_clang_storage_class_specifiers")) { switch (SC) { Index: cfe/trunk/lib/Sema/SemaCast.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaCast.cpp +++ cfe/trunk/lib/Sema/SemaCast.cpp @@ -285,7 +285,7 @@ AngleBrackets)); case tok::kw_dynamic_cast: { - // OpenCL C++ 1.0 s2.9: dynamic_cast is not supported. + // dynamic_cast is not supported in C++ for OpenCL. if (getLangOpts().OpenCLCPlusPlus) { return ExprError(Diag(OpLoc, diag::err_openclcxx_not_supported) << "dynamic_cast"); Index: cfe/trunk/lib/Sema/SemaDecl.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaDecl.cpp +++ cfe/trunk/lib/Sema/SemaDecl.cpp @@ -6428,8 +6428,8 @@ } } - // OpenCL C++ 1.0 s2.9: the thread_local storage qualifier is not - // supported. OpenCL C does not support thread_local either, and + // C++ for OpenCL does not allow the thread_local storage qualifier. + // OpenCL C does not support thread_local either, and // also reject all other thread storage class specifiers. DeclSpec::TSCS TSC = D.getDeclSpec().getThreadStorageClassSpec(); if (TSC != TSCS_unspecified) { @@ -7435,9 +7435,8 @@ // OpenCL C v2.0 s6.5.1 - Variables defined at program scope and static // variables inside a function can also be declared in the global // address space. - // OpenCL C++ v1.0 s2.5 inherits rule from OpenCL C v2.0 and allows local - // address space additionally. - // FIXME: Add local AS for OpenCL C++. + // C++ for OpenCL inherits rule from OpenCL C v2.0. + // FIXME: Adding local AS in C++ for OpenCL might make sense. if (NewVD->isFileVarDecl() || NewVD->isStaticLocal() || NewVD->hasExternalStorage()) { if (!T->isSamplerT() && @@ -11590,7 +11589,7 @@ // do nothing // OpenCL v1.2 s6.5.3: __constant locals must be constant-initialized. - // This is true even in OpenCL C++. + // This is true even in C++ for OpenCL. } else if (VDecl->getType().getAddressSpace() == LangAS::opencl_constant) { CheckForConstantInitializer(Init, DclT); Index: cfe/trunk/lib/Sema/SemaDeclCXX.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp @@ -13272,7 +13272,7 @@ diag::err_operator_new_delete_dependent_result_type) << FnDecl->getDeclName() << ExpectedResultType; - // OpenCL C++: the operator is valid on any address space. + // The operator is valid on any address space for OpenCL. if (SemaRef.getLangOpts().OpenCLCPlusPlus) { if (auto *PtrTy = ResultType->getAs()) { ResultType = RemoveAddressSpaceFromPtr(SemaRef, PtrTy); @@ -13305,7 +13305,7 @@ // Check that the first parameter type is what we expect. if (SemaRef.getLangOpts().OpenCLCPlusPlus) { - // OpenCL C++: the operator is valid on any address space. + // The operator is valid on any address space for OpenCL. if (auto *PtrTy = FnDecl->getParamDecl(0)->getType()->getAs()) { FirstParamType = RemoveAddressSpaceFromPtr(SemaRef, PtrTy); Index: cfe/trunk/lib/Sema/SemaExprCXX.cpp =================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp @@ -529,7 +529,7 @@ ExprResult Sema::ActOnCXXTypeid(SourceLocation OpLoc, SourceLocation LParenLoc, bool isType, void *TyOrExpr, SourceLocation RParenLoc) { - // OpenCL C++ 1.0 s2.9: typeid is not supported. + // typeid is not supported in OpenCL. if (getLangOpts().OpenCLCPlusPlus) { return ExprError(Diag(OpLoc, diag::err_openclcxx_not_supported) << "typeid"); @@ -2656,8 +2656,8 @@ if (GlobalNewDeleteDeclared) return; - // OpenCL C++ 1.0 s2.9: the implicitly declared new and delete operators - // are not supported. + // The implicitly declared new and delete operators + // are not supported in OpenCL. if (getLangOpts().OpenCLCPlusPlus) return; Index: cfe/trunk/test/Driver/unknown-std.cl =================================================================== --- cfe/trunk/test/Driver/unknown-std.cl +++ cfe/trunk/test/Driver/unknown-std.cl @@ -10,7 +10,7 @@ // CHECK-NEXT: note: use 'cl1.1' for 'OpenCL 1.1' standard // CHECK-NEXT: note: use 'cl1.2' for 'OpenCL 1.2' standard // CHECK-NEXT: note: use 'cl2.0' for 'OpenCL 2.0' standard -// CHECK-NEXT: note: use 'c++' for 'OpenCL C++ 1.0' standard +// CHECK-NEXT: note: use 'c++' for 'C++ for OpenCL' standard // Make sure that no other output is present. // CHECK-NOT: {{^.+$}} Index: cfe/trunk/test/Parser/opencl-cxx-keywords.cl =================================================================== --- cfe/trunk/test/Parser/opencl-cxx-keywords.cl +++ cfe/trunk/test/Parser/opencl-cxx-keywords.cl @@ -2,7 +2,7 @@ // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -verify -fsyntax-only -fexceptions -fcxx-exceptions // This test checks that various C++ and OpenCL C keywords are not available -// in OpenCL C++, according to OpenCL C++ 1.0 Specification Section 2.9. +// in OpenCL. // Test that exceptions are disabled despite passing -fcxx-exceptions. kernel void test_exceptions() { Index: cfe/trunk/test/Parser/opencl-cxx-virtual.cl =================================================================== --- cfe/trunk/test/Parser/opencl-cxx-virtual.cl +++ cfe/trunk/test/Parser/opencl-cxx-virtual.cl @@ -3,17 +3,17 @@ // Test that virtual functions and abstract classes are rejected. class virtual_functions { virtual void bad1() {} - //expected-error@-1 {{virtual functions are not supported in OpenCL C++}} + //expected-error@-1 {{virtual functions are not supported in C++ for OpenCL}} virtual void bad2() = 0; - //expected-error@-1 {{virtual functions are not supported in OpenCL C++}} + //expected-error@-1 {{virtual functions are not supported in C++ for OpenCL}} //expected-error@-2 {{'bad2' is not virtual and cannot be declared pure}} }; template class X { virtual T f(); - //expected-error@-1 {{virtual functions are not supported in OpenCL C++}} + //expected-error@-1 {{virtual functions are not supported in C++ for OpenCL}} }; // Test that virtual base classes are allowed. Index: cfe/trunk/test/SemaOpenCLCXX/newdelete.cl =================================================================== --- cfe/trunk/test/SemaOpenCLCXX/newdelete.cl +++ cfe/trunk/test/SemaOpenCLCXX/newdelete.cl @@ -19,8 +19,8 @@ // There are no global user-defined new operators at this point. Test that clang // rejects these gracefully. void test_default_new_delete(void *buffer, A **pa) { - A *a = new A; // expected-error {{'default new' is not supported in OpenCL C++}} - delete a; // expected-error {{'default delete' is not supported in OpenCL C++}} + A *a = new A; // expected-error {{'default new' is not supported in C++ for OpenCL}} + delete a; // expected-error {{'default delete' is not supported in C++ for OpenCL}} *pa = new (buffer) A; // expected-error {{use of placement new requires explicit declaration}} } @@ -36,10 +36,10 @@ void test_new_delete(void *buffer, A **a, B **b) { *a = new A; // expected-error {{no matching function for call to 'operator new'}} - delete a; // expected-error {{'default delete' is not supported in OpenCL C++}} + delete a; // expected-error {{'default delete' is not supported in C++ for OpenCL}} *a = new A[20]; // expected-error {{no matching function for call to 'operator new[]'}} - delete[] *a; // expected-error {{'default delete' is not supported in OpenCL C++}} + delete[] *a; // expected-error {{'default delete' is not supported in C++ for OpenCL}} // User-defined placement new is supported. *a = new (buffer) A; Index: cfe/trunk/test/SemaOpenCLCXX/restricted.cl =================================================================== --- cfe/trunk/test/SemaOpenCLCXX/restricted.cl +++ cfe/trunk/test/SemaOpenCLCXX/restricted.cl @@ -1,9 +1,9 @@ // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -pedantic -verify -fsyntax-only // This test checks that various C/C++/OpenCL C constructs are not available in -// OpenCL C++, according to OpenCL C++ 1.0 Specification Section 2.9. +// C++ for OpenCL. -// Test that typeid is not available in OpenCL C++. +// Test that typeid is not available. namespace std { // Provide a dummy std::type_info so that we can use typeid. class type_info { @@ -11,9 +11,9 @@ }; } __constant std::type_info int_ti = typeid(int); -// expected-error@-1 {{'typeid' is not supported in OpenCL C++}} +// expected-error@-1 {{'typeid' is not supported in C++ for OpenCL}} -// Test that dynamic_cast is not available in OpenCL C++. +// Test that dynamic_cast is not available in C++ for OpenCL. class A { public: int a; @@ -25,17 +25,17 @@ B *test_dynamic_cast(B *p) { return dynamic_cast(p); - // expected-error@-1 {{'dynamic_cast' is not supported in OpenCL C++}} + // expected-error@-1 {{'dynamic_cast' is not supported in C++ for OpenCL}} } // Test storage class qualifiers. __constant _Thread_local int a = 1; -// expected-error@-1 {{OpenCL C++ version 1.0 does not support the '_Thread_local' storage class specifier}} +// expected-error@-1 {{C++ for OpenCL version 1.0 does not support the '_Thread_local' storage class specifier}} __constant __thread int b = 2; -// expected-error@-1 {{OpenCL C++ version 1.0 does not support the '__thread' storage class specifier}} +// expected-error@-1 {{C++ for OpenCL version 1.0 does not support the '__thread' storage class specifier}} kernel void test_storage_classes() { register int x; - // expected-error@-1 {{OpenCL C++ version 1.0 does not support the 'register' storage class specifier}} + // expected-error@-1 {{C++ for OpenCL version 1.0 does not support the 'register' storage class specifier}} thread_local int y; - // expected-error@-1 {{OpenCL C++ version 1.0 does not support the 'thread_local' storage class specifier}} + // expected-error@-1 {{C++ for OpenCL version 1.0 does not support the 'thread_local' storage class specifier}} }