[PATCH] D52521: [Sema] DR727: Ensure we pick up enclosing template instantiation arguments for a class-scope explicit specialization.

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 3 17:47:03 PDT 2018


rsmith added inline comments.


================
Comment at: clang/include/clang/AST/DeclTemplate.h:1771-1779
+  void setIsSpecializedMember(bool V = true) { IsSpecializedMember = V; }
+
+  /// If this class template specialization was declared at class scope (DR727).
+  /// For example, the specialization G<int> below:
+  ///   struct S {
+  ///     template <class> struct G {};
+  ///     template <> struct G<int> {};
----------------
I think this name is confusing, given that we also have `isMemberSpecialization`, which is an entirely different thing.

Maybe `isInstantiatedSpecialization` would capture the essence here? (That is, this is a partial or explicit specialization that we instantiated from its enclosing template context rather than one that was declared in a non-template context.)

That also makes me wonder if we need to store additional state for this at all, or if we can determine this by checking whether the (first) declaration `isOutOfLine()`.


Repository:
  rC Clang

https://reviews.llvm.org/D52521





More information about the cfe-commits mailing list