Skip to content

Commit 50434e8

Browse files
committed
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 llvm-svn: 361467
1 parent e98a8f7 commit 50434e8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10808,7 +10808,7 @@ QualType Sema::CheckCompareOperands(ExprResult &LHS, ExprResult &RHS,
1080810808
return computeResultTy();
1080910809
}
1081010810

10811-
if (getLangOpts().OpenCLVersion >= 200) {
10811+
if (getLangOpts().OpenCLVersion >= 200 || getLangOpts().OpenCLCPlusPlus) {
1081210812
if (LHSType->isClkEventT() && RHSType->isClkEventT()) {
1081310813
return computeResultTy();
1081410814
}

clang/test/SemaOpenCL/clk_event_t.cl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
2+
// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=c++
23

34
// Taken from opencl-c.h
45
#define CLK_NULL_EVENT (__builtin_astype(((void*)(__SIZE_MAX__)), clk_event_t))

0 commit comments

Comments
 (0)