svenvh created this revision. svenvh added a reviewer: Anastasia. Herald added subscribers: cfe-commits, yaxunl. Herald added a project: clang.
Support queue_t and clk_event_t comparisons in C++ for OpenCL mode, to preserve backwards compatibility with OpenCL C. Repository: rC Clang https://reviews.llvm.org/D62208 Files: lib/Sema/SemaExpr.cpp test/SemaOpenCL/clk_event_t.cl Index: test/SemaOpenCL/clk_event_t.cl =================================================================== --- test/SemaOpenCL/clk_event_t.cl +++ test/SemaOpenCL/clk_event_t.cl @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=c++ // Taken from opencl-c.h #define CLK_NULL_EVENT (__builtin_astype(((void*)(__SIZE_MAX__)), clk_event_t)) Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -10808,7 +10808,7 @@ return computeResultTy(); } - if (getLangOpts().OpenCLVersion >= 200) { + if (getLangOpts().OpenCLVersion >= 200 || getLangOpts().OpenCLCPlusPlus) { if (LHSType->isClkEventT() && RHSType->isClkEventT()) { return computeResultTy(); }
Index: test/SemaOpenCL/clk_event_t.cl =================================================================== --- test/SemaOpenCL/clk_event_t.cl +++ test/SemaOpenCL/clk_event_t.cl @@ -1,4 +1,5 @@ // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0 +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=c++ // Taken from opencl-c.h #define CLK_NULL_EVENT (__builtin_astype(((void*)(__SIZE_MAX__)), clk_event_t)) Index: lib/Sema/SemaExpr.cpp =================================================================== --- lib/Sema/SemaExpr.cpp +++ lib/Sema/SemaExpr.cpp @@ -10808,7 +10808,7 @@ return computeResultTy(); } - if (getLangOpts().OpenCLVersion >= 200) { + if (getLangOpts().OpenCLVersion >= 200 || getLangOpts().OpenCLCPlusPlus) { if (LHSType->isClkEventT() && RHSType->isClkEventT()) { return computeResultTy(); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits