r361467 - Enable queue_t and clk_event_t comparisons in C++ mode
Sven van Haastregt via cfe-commits
cfe-commits at lists.llvm.org
Thu May 23 02:20:09 PDT 2019
Author: svenvh
Date: Thu May 23 02:20:08 2019
New Revision: 361467
URL: http://llvm.org/viewvc/llvm-project?rev=361467&view=rev
Log:
Enable queue_t and clk_event_t comparisons in C++ mode
Support queue_t and clk_event_t comparisons in C++ for OpenCL mode, to
preserve backwards compatibility with OpenCL C.
Differential Revision: https://reviews.llvm.org/D62208
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaOpenCL/clk_event_t.cl
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=361467&r1=361466&r2=361467&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Thu May 23 02:20:08 2019
@@ -10808,7 +10808,7 @@ QualType Sema::CheckCompareOperands(Expr
return computeResultTy();
}
- if (getLangOpts().OpenCLVersion >= 200) {
+ if (getLangOpts().OpenCLVersion >= 200 || getLangOpts().OpenCLCPlusPlus) {
if (LHSType->isClkEventT() && RHSType->isClkEventT()) {
return computeResultTy();
}
Modified: cfe/trunk/test/SemaOpenCL/clk_event_t.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaOpenCL/clk_event_t.cl?rev=361467&r1=361466&r2=361467&view=diff
==============================================================================
--- cfe/trunk/test/SemaOpenCL/clk_event_t.cl (original)
+++ cfe/trunk/test/SemaOpenCL/clk_event_t.cl Thu May 23 02:20:08 2019
@@ -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))
More information about the cfe-commits
mailing list