https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88655
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Using C++98 (on a LP64 target) and:
typedef unsigned long uint64_t;
typedef long int64_t;
struct Foo { Foo(int64_t) { } };
void foo(const char*)
{
std::puts("In foo(const char*)");
}
void foo(const Foo&)
{
std::puts("In foo(const Foo&)");
}
int main()
{
foo((int)0);
foo((unsigned)0);
foo((short)0);
foo((unsigned short)0);
foo((int64_t)0);
foo((uint64_t)0);
foo(0);
foo(NULL);
}
--- CUT ---
In foo(const char*)
In foo(const char*)
In foo(const char*)
In foo(const char*)
In foo(const char*)
In foo(const char*)
In foo(const char*)
In foo(const char*)
As you can see that is the "old" behavior.
With -std=c++11, I get:
In foo(const Foo&)
In foo(const char*)
In foo(const char*)
In foo(const char*)
In foo(const char*)
In foo(const char*)
In foo(const char*)
In foo(const char*)