[PATCH] D64400: [OpenCL][PR42390] Deduce addr space for templ specialization

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 9 23:09:15 PDT 2019


rjmccall added inline comments.


================
Comment at: include/clang/AST/Type.h:6512
+inline bool Type::isTemplateSpecializationType() const {
+  return isa<TemplateSpecializationType>(this);
+}
----------------
This is a sugar type.  What are you trying to do?


================
Comment at: lib/Sema/SemaType.cpp:7417
       // up instantiating to a type with an explicit address space qualifier.
-      // Expect for pointer or reference types because the addr space in
-      // template argument can only belong to a pointee.
-      (T->isDependentType() && !T->isPointerType() && !T->isReferenceType()) ||
+      // Expect for:
+      // - pointer or reference types because the addr space in template
----------------
"Except"?


================
Comment at: lib/Sema/SemaType.cpp:7421
+      // - template specialization as addr space in template argument doesn't
+      //   affect specialization.
+      (T->isDependentType() && (!T->isPointerType() && !T->isReferenceType() &&
----------------
I don't understand what you're saying here.  Why does inference depend on whether the type is a template specialization?  And what does this have to do with template arguments?  Also, address spaces in template arguments are definitely part of the template argument and affect which specialization you're naming.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64400/new/

https://reviews.llvm.org/D64400





More information about the cfe-commits mailing list