Consider the following snippet:
struct Base { };
struct Derived : Base { };
void f(Base &) { std::cout << \"f(Base&)\\n\"; }
template
According to c++ draft (n4582) §14.7.1.5:
Unless a function template specialization has been explicitly instantiated or explicitly specialized, the function template specialization is implicitly instantiated when the specialization is referenced in a context that requires a function definition to exist. Unless a call is to a function template explicit specialization or to a member function of an explicitly specialized class template, a default argument for a function template or a member function of a class template is implicitly instantiated when the function is called in a context that requires the value of the default argument.
I would say gcc is more correct about this.
If you for example create an specialized version of void g()
you get both compiler doing the same.