]> granicus.if.org Git - clang/commit
[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)
commitcabb0bc32ee394b51a4f3ff4fe7fac4df47fe573
treedaa9c6d282dc6ee683239fbb54a8727f909a1a67
parentbad4f7292a0c3e478729fadd890647d73f90b024
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366417 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
lib/Sema/SemaType.cpp
lib/Sema/TreeTransform.h
test/SemaOpenCLCXX/address-space-deduction.cl
test/SemaOpenCLCXX/address-space-templates.cl