[OpenCL][PR42033] Fix addr space deduction with template parameters
authorAnastasia Stulova <anastasia.stulova@arm.com>
Thu, 18 Jul 2019 09:12:49 +0000 (09:12 +0000)
committerAnastasia Stulova <anastasia.stulova@arm.com>
Thu, 18 Jul 2019 09:12:49 +0000 (09:12 +0000)
commit36d9e8358aa2e24abc280af4811eac5d5c65557f
tree07947dbc7ef26c49fb85997dbc967cf2601bdb50
parentf26706fa1c15090774868fd9d259c7882e553319
[OpenCL][PR42033] Fix addr space deduction with template parameters

If dependent types appear in pointers or references we allow addr
space deduction because the addr space in template argument will
belong to the pointee and not the pointer or reference itself.

We also don't diagnose addr space on a function return type after
template instantiation. If any addr space for the return type was
provided on a template parameter this will be diagnosed during the
parsing of template definition.

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

llvm-svn: 366417
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaType.cpp
clang/lib/Sema/TreeTransform.h
clang/test/SemaOpenCLCXX/address-space-deduction.cl
clang/test/SemaOpenCLCXX/address-space-templates.cl