Skip to content

Fix missing symbols for template functions with enable_if#506

Merged
jupblb merged 1 commit into
mainfrom
michal/gm-issue
Feb 17, 2026
Merged

Fix missing symbols for template functions with enable_if#506
jupblb merged 1 commit into
mainfrom
michal/gm-issue

Conversation

@jupblb

@jupblb jupblb commented Dec 19, 2025

Copy link
Copy Markdown
Member

Root cause: In getFunctionDisambiguator(), when handling template function instantiations, the code only handled two cases:

  1. Non-templated member functions of class templates (getInstantiatedFromMemberFunction)
  2. Member function templates inside class templates (getInstantiatedFromMemberTemplate)

It missed the case of member function templates in non-template classes (like Flashing::bind<T>) and free function templates (like ToString<T>). When getInstantiatedFromMemberTemplate() returned null, definingDecl was left pointing at the instantiated declaration, causing unstable/missing symbols.

Fix: Added an else branch to use
instantiatedTemplateDecl->getTemplatedDecl() directly when getInstantiatedFromMemberTemplate() returns null.

@jupblb jupblb self-assigned this Dec 19, 2025
@jupblb jupblb added the bug Something isn't working label Dec 19, 2025
Root cause: In getFunctionDisambiguator(), when handling template
function instantiations, the code only handled two cases:
1. Non-templated member functions of class templates
2. Member function templates inside class templates

It missed the case of member function templates in non-template classes
(like Flashing::bind<T>) and free function templates (like ToString<T>).
When getInstantiatedFromMemberTemplate() returned null, definingDecl was
left pointing at the instantiated declaration, causing unstable/missing
symbols.

Fix: Added an else branch to use
instantiatedTemplateDecl->getTemplatedDecl() directly when
getInstantiatedFromMemberTemplate() returns null.
@jupblb

jupblb commented Feb 17, 2026

Copy link
Copy Markdown
Member Author

We have a confirmation that this fix works.

@jupblb jupblb merged commit efd5091 into main Feb 17, 2026
7 checks passed
@jupblb jupblb deleted the michal/gm-issue branch February 17, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant