Skip to content

Commit

Permalink
Enable queue_t and clk_event_t comparisons in C++ mode
Browse files Browse the repository at this point in the history
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361467 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
svenvh committed May 23, 2019
1 parent 37d9edc commit 0ff106e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10808,7 +10808,7 @@ QualType Sema::CheckCompareOperands(ExprResult &LHS, ExprResult &RHS,
return computeResultTy();
}

if (getLangOpts().OpenCLVersion >= 200) {
if (getLangOpts().OpenCLVersion >= 200 || getLangOpts().OpenCLCPlusPlus) {
if (LHSType->isClkEventT() && RHSType->isClkEventT()) {
return computeResultTy();
}
Expand Down
1 change: 1 addition & 0 deletions test/SemaOpenCL/clk_event_t.cl
Original file line number Diff line number Diff line change
@@ -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))
Expand Down

0 comments on commit 0ff106e

Please sign in to comment.