[PATCH] D54858: [OpenCL] Improve diagnostics for address spaces in template instantiation
Anastasia Stulova via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 28 04:49:03 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();
+
----------------
Anastasia wrote:
> 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.
I think indeed this was wrong! Instead I now just prevent deduction of address spaces for dependent types. I think this is the only use case. So I don't think we need to do anything here any more.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54858/new/
https://reviews.llvm.org/D54858
More information about the cfe-commits
mailing list