diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h index a82954ddd326..4e86168b4f36 100644 --- a/clang/lib/Headers/opencl-c-base.h +++ b/clang/lib/Headers/opencl-c-base.h @@ -413,7 +413,7 @@ typedef enum memory_order #define CLK_OUT_OF_RESOURCES -5 #define CLK_NULL_QUEUE 0 -#define CLK_NULL_EVENT (__builtin_astype(((void*)(__SIZE_MAX__)), clk_event_t)) +#define CLK_NULL_EVENT (__builtin_astype(((__SIZE_MAX__)), clk_event_t)) // execution model related definitions #define CLK_ENQUEUE_FLAGS_NO_WAIT 0x0 diff --git a/clang/test/SemaOpenCL/clk_event_t.cl b/clang/test/SemaOpenCL/clk_event_t.cl index 4a884bcfa6c0..8c48933710d0 100644 --- a/clang/test/SemaOpenCL/clk_event_t.cl +++ b/clang/test/SemaOpenCL/clk_event_t.cl @@ -2,7 +2,7 @@ // 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)) +#define CLK_NULL_EVENT (__builtin_astype(((__SIZE_MAX__)), clk_event_t)) global clk_event_t ce; // expected-error {{the '__global clk_event_t' type cannot be used to declare a program scope variable}} @@ -10,6 +10,7 @@ int clk_event_tests() { event_t e; clk_event_t ce1; clk_event_t ce2; + clk_event_t ce3 = CLK_NULL_EVENT; if (e == ce1) { // expected-error {{invalid operands to binary expression ('event_t' and 'clk_event_t')}} return 9;