[clang] [clang] Track function template instantiation from definition (PR #110387)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 8 18:50:34 PDT 2024
================
@@ -1008,6 +1008,15 @@ class FunctionTemplateDecl : public RedeclarableTemplateDecl {
return getTemplatedDecl()->isThisDeclarationADefinition();
}
+ bool isCompatibleWithDefinition() const {
+ return getTemplatedDecl()->isInstantiatedFromMemberTemplate() ||
+ isThisDeclarationADefinition();
+ }
+ void setInstantiatedFromMemberTemplate(FunctionTemplateDecl *D) {
+ getTemplatedDecl()->setInstantiatedFromMemberTemplate();
+ RedeclarableTemplateDecl::setInstantiatedFromMemberTemplate(D);
+ }
----------------
mizvekov wrote:
getInstantiatedFromMemberTemplate() uses the common area, which means whenever you set it for one declaration, it's set the same for all its redeclarations.
But the flag does not use the common area, it's a separate flag per redeclaration.
https://github.com/llvm/llvm-project/pull/110387
More information about the cfe-commits
mailing list