[PATCH] D65744: [PR42707][OpenCL] Fix addr space deduction for auto
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 5 06:34:39 PDT 2019
Anastasia created this revision.
Anastasia added a reviewer: rjmccall.
Herald added subscribers: ebevhan, yaxunl.
A regression was introduced in D64400 <https://reviews.llvm.org/D64400> because auto is using the same logic as templates. However, deduction of addr spaces wasn't working correctly even before.
Here are the rules that are implemented in this patch:
- For non-reference and non-pointer types deduction can be done early because addr space is not going to be taken from init expr
- For ref or ptr auto types we should prevent deducing addr space before the deduction of the whole type (incl its pointee addr spaces) from init expr
https://reviews.llvm.org/D65744
Files:
include/clang/AST/Type.h
lib/Sema/SemaType.cpp
lib/Sema/TreeTransform.h
test/SemaOpenCLCXX/addrspace-auto.cl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65744.213345.patch
Type: text/x-patch
Size: 5584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190805/e8473edf/attachment-0001.bin>
More information about the cfe-commits
mailing list