Skip to content

Fix SFINAE calling a function template with deduced return type and pending definition - #322

Open
cpplearner wants to merge 3 commits into
edgcpp:mainfrom
cpplearner:auto-pending-inst
Open

cpplearner wants to merge 3 commits into
edgcpp:mainfrom
cpplearner:auto-pending-inst

Conversation

@cpplearner

Copy link
Copy Markdown
Contributor

With modules, it is possible that a function template definition exists in a module but the definition is not yet loaded. In such a case, routine->defined is false, despite the existence of a definition. Previously, substitution failed if such a function template is called in a SFINAE context and the function template has a deduced return type. This is fixed in this PR.

See #242 for an example.

Fixes #242

@cpplearner

Copy link
Copy Markdown
Contributor Author
  • Call has_pending_template_definition_from_module only if routine refers to a template instance.
  • Drive by: simplify the neighboring friend_defined_in_instantiation check. The routine pointer was assigned routine_sym->variant.routine.ptr.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant