[clang] Reland: [clang] Track function template instantiation from definition (PR #125266)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 07:04:20 PST 2025


================
@@ -2298,6 +2298,13 @@ class FunctionDecl : public DeclaratorDecl,
     FunctionDeclBits.IsLateTemplateParsed = ILT;
   }
 
+  bool isInstantiatedFromMemberTemplate() const {
+    return FunctionDeclBits.IsInstantiatedFromMemberTemplate;
+  }
+  void setInstantiatedFromMemberTemplate(bool Val = true) {
+    FunctionDeclBits.IsInstantiatedFromMemberTemplate = Val;
+  }
+
----------------
erichkeane wrote:

This is a 'thanks i hate it' :)  Basically, the `RedeclarableTemplateDecl` applies to the declaration chain, but this is separately tracking on a per-declaration basis.  It is a little frustrating that we have to do this.

But I think we're stuck with it unless someone has a better idea


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


More information about the cfe-commits mailing list