[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 10 10:36:51 PDT 2024


================
@@ -860,6 +860,16 @@ class RedeclarableTemplateDecl : public TemplateDecl,
   /// \endcode
   bool isMemberSpecialization() const { return Common.getInt(); }
 
+  /// Determines whether any redeclaration of this template was
+  /// a specialization of a member template.
+  bool hasMemberSpecialization() const {
+    for (const auto *D : redecls()) {
+      if (D->isMemberSpecialization())
+        return true;
+    }
+    return false;
----------------
mizvekov wrote:

At least for RedeclarableTemplate, there is a common area which is shared by all redeclarations of a decl.
This could be implemented as a bit there, which would make sense in case the common area is used, thus allocated, for these users anyway.

Not required, just pointing out the possibility.

https://github.com/llvm/llvm-project/pull/111852


More information about the cfe-commits mailing list