Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -11345,8 +11345,7 @@ if (getLangOpts().OpenCL) { // OpenCL v2.0 s6.12.5 - Every block variable declaration must have an // initialiser - if (var->getTypeSourceInfo()->getType()->isBlockPointerType() && - !var->hasInit()) { + if (var->getType()->isBlockPointerType() && !var->hasInit()) { Diag(var->getLocation(), diag::err_opencl_invalid_block_declaration) << 1 /*Init*/; var->setInvalidDecl(); Index: test/SemaOpenCL/omp_simd.cl =================================================================== --- /dev/null +++ test/SemaOpenCL/omp_simd.cl @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -verify -fopenmp -fsyntax-only -x cl %s +// expected-no-diagnostics + +__kernel void test(__global int *data, int size) { + #pragma omp simd + for (int i = 0; i < size; ++i) { + } +}