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
This commit is contained in:
Sven van Haastregt 2019-05-23 09:20:08 +00:00
parent e98a8f7b2a
commit 50434e8df0
2 changed files with 2 additions and 1 deletions

View File

@ -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();
}

View File

@ -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))