I'm trying to compile some code in VS2019 with /permissive- that involves both templates and overloading and wierd things are happening. (https://godbolt.org/z/fBbQu6)
As in the godbolt, when my templateFunc() is declared between two overloads like so:
namespace Foospace {
class A;
void func(A*) {};
template<class T> void templateFunc() { Foospace::func((T*)0); }
class B;
void func(B*) {};
void func() { Foospace::templateFunc<B>(); }
}
Run Code Online (Sandbox Code Playgroud)
I get error C2664: 'void Foospace::func(Foospace::A *)': cannot convert argument 1 from 'T *' to 'Foospace::A …