https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52145

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|88655                       |94404
              Alias|                            |cwg903

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is a testcase which tests all of the null pointerness in C++11 (+):
#include <cstddef>
extern "C" int puts(const char*);
typedef unsigned long uint64_t;
typedef long int64_t;

struct Foo { Foo(int64_t) { } };
bool t = true;

void foo(const char*)
{
  if (t)
    __builtin_abort();
  puts("In foo(const char*)");
}

void foo(const Foo&)
{
  if (!t)
    __builtin_abort();
  puts("In foo(const Foo&)");
}

int main()
{
#if __cplusplus >= 201103L
  t= true;
#else
  t= false;
#endif
  foo((int)0);
  foo((unsigned)0);
  foo((short)0);
  foo((unsigned short)0);
  foo((int64_t)0);
  foo((uint64_t)0);
  foo(int());
#if __cplusplus >= 201103L
  foo(int{});
  t= false;
  foo(nullptr);
#endif
  foo(0u);
  foo(0ul);
  foo(0ull);
  foo(0);
  foo(NULL);
}

---- CUT ----
We get this right for C++98 but wrong for C++11.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88655
[Bug 88655] Different overloaded function being called depending on which
compiler is used
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94404
[Bug 94404] [meta-bug] C++ core issues

Reply via email to