[Sema] Prevent binding incompatible addr space ref to temporaries
authorAnastasia Stulova <anastasia.stulova@arm.com>
Wed, 5 Jun 2019 14:03:34 +0000 (14:03 +0000)
committerAnastasia Stulova <anastasia.stulova@arm.com>
Wed, 5 Jun 2019 14:03:34 +0000 (14:03 +0000)
commit5145b1e4421adb3ac7e558cb88c9a2100ccb2b44
tree597b0c357a9ac773f09037432ebda68a17ea0a1b
parent22e99c434fb65ca8a9d5e3dbf5db5965681ce5c3
[Sema] Prevent binding incompatible addr space ref to temporaries

References to arbitrary address spaces can't always be bound to
temporaries. This change extends the reference binding logic to
check that the address space of a temporary can be implicitly
converted to the address space in a reference when temporary
materialization is performed.

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

llvm-svn: 362604
clang/include/clang/AST/Type.h
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Initialization.h
clang/lib/Sema/SemaInit.cpp
clang/test/SemaOpenCLCXX/address-space-references.cl [new file with mode: 0644]