[OpenCL] Fix address space for implicit conversion (PR43145)
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 2 Dec 2019 14:20:15 +0000 (14:20 +0000)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 2 Dec 2019 14:20:15 +0000 (14:20 +0000)
commit62364965619bd7e8847418b21ec327a78bd1624c
treeea10a004ff04de5d8ddb7f30b537fcaf53e26142
parentd62026e2dde1d27c7d1c702f11b0464e1d470d4f
[OpenCL] Fix address space for implicit conversion (PR43145)

Clang was creating a DerivedToBase ImplicitCastExpr that was also
casting between address spaces as part of the second step in the
standard conversion sequence.  Defer the address space conversion to
the third step in the sequence instead, such that we get a separate
ImplicitCastExpr for the address space conversion.

Differential Revision: https://reviews.llvm.org/D70605
clang/lib/Sema/SemaExprCXX.cpp
clang/test/CodeGenOpenCLCXX/addrspace-derived-base.cl