This is because "ASDADS" converted to char * . Thus, the compiler generates code for the first function, which may correspond to the argument.
If you remove the prototype using char * , the compiler will look for functions that accept a parameter with an implicit conversion from char * to the parameter type.
Take for example the following:
class A { public: A() {} A(int x) {} };
if you comment out foo(int x) , another function is called.
However, if you declare the constructor as explicit , you will receive an error message:
class A { public: A() {} explicit A(int x) {} };
source share