Skip to content

Injecting definition after declaration of template function cause ambiguous function call #305

Description

@DaemonSnake

Hi!

I have a situation where I need to first declare a function template before defining it later on.
But when trying to inject the definition, instead of associating it to the declaration it handles it as a new function, causing subsequent calls to be "ambiguous".

minimal example:

  template<class T>
  void func();
  
  consteval -> fragment namespace {
      template<class T>
      void func() {}
  };
  
  int main() {
      func<int>(); // ambigous
  }

godbolt link: https://godbolt.org/z/Tfrddzz53

Thanks in advance ^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions