[OpenCL] Handle address space conversions for constexpr (PR44177)
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 9 Dec 2019 11:08:19 +0000 (11:08 +0000)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 9 Dec 2019 11:09:16 +0000 (11:09 +0000)
commitf3e6a61232640f2ec78b97d44cc0b5ba12676a0d
tree7b60416f5724fdc53cd387ae45e1306a696f799d
parent9ed681f9261d70802c3ba111d1c3e4e56f582112
[OpenCL] Handle address space conversions for constexpr (PR44177)

The AST for the constexpr.cl test contains address space conversion
nodes to cast through the implicit generic address space.  These
caused the evaluator to reject the input as constexpr in C++ for
OpenCL mode, whereas the input was considered constexpr in plain C++
mode as the AST won't have address space cast nodes then.

Fixes PR44177.

Differential Revision: https://reviews.llvm.org/D71015
clang/lib/AST/ExprConstant.cpp
clang/test/CodeGenOpenCLCXX/address-space-deduction.cl
clang/test/CodeGenOpenCLCXX/constexpr.cl [new file with mode: 0644]