This is my Snippet:
class Base{};
class Derived : private Base{};
template<class T>
class Wrapper
{
public:
template<typename T2>
Wrapper( T2&& )
{ }
};
// Function declarations
void func( Base& param );
void func( Wrapper<Derived> );
void funcUnambiguous( Wrapper<Derived> );
// Here is the Call:
Derived d = Derived();
func( d ); // <- Error
GCC 4.9 gives me: error: 'Base' is an inaccessible base of 'Derived'
Whereas I do
Derived d = Derived();
funcUnambiguous( d );
it just works fine.
It seems like, any function only requiring a cheap cast, even if malformed, hides implicit, but expensive-cast functions. Does anybody have clue?