[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 27 11:49:06 PST 2018
Anastasia marked an inline comment as done.
Anastasia added inline comments.
================
Comment at: lib/Sema/TreeTransform.h:4241
+ if (SemaRef.getLangOpts().OpenCL && T.getType()->isTemplateTypeParmType())
+ Quals.removeAddressSpace();
+
----------------
rjmccall wrote:
> When do you actually add the qualifier back?
>
> Also, I don't think this is specific to either OpenCL or direct references to template type parameters; it has to be any dependent type.
As far as I understand the qualifiers here are only used to rebuild the type. Therefore I assumed I don't need to restore the original. I am now thinking of moving this down into `RebuildQualifiedType` that has similar code for handling qualifiers.
However, after enabling it for C++ in general I am getting some issues with deduction of templates with pointers that have address spaces in pointees. So I am investigating this further whether it's the right approach at all.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54858/new/
https://reviews.llvm.org/D54858
More information about the cfe-commits
mailing list