[OpenCL] Ignore parentheses for sampler initialization
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 12 Aug 2019 12:44:26 +0000 (12:44 +0000)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 12 Aug 2019 12:44:26 +0000 (12:44 +0000)
commit06385d013d08b47008983567bf52bdb909801b4f
tree560471759b0623d95c7f0feb25b356d48f1dec44
parent5b96d4655c868ce5a4df4b472b90b543344b5386
[OpenCL] Ignore parentheses for sampler initialization

The sampler handling logic in SemaInit.cpp would inadvertently treat
parentheses around sampler arguments as an implicit cast, leading to
an unreachable "can't implicitly cast lvalue to rvalue with
this cast kind".  Fix by ignoring parentheses once we are in the
sampler initializer case.

Differential Revision: https://reviews.llvm.org/D66080

llvm-svn: 368561
clang/lib/Sema/SemaInit.cpp
clang/test/SemaOpenCL/sampler_t.cl