This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52174] [DR 1423] Implicit conversion of nullptr to bool


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52174

Daniel KrÃgler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #4 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-07-20 18:58:28 UTC ---
DR 1423 has now reached ready status, 

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1423

so this seems like a good reason to consider a compiler change to evaluate
potential code breakages.

Here some recommended test-cases that should hold:

1)

bool b1 = nullptr; // Is well-formed today, needs to be ill-formed

2)

bool b2(nullptr); // well-formed today and under 1423

3)

template<class T>
T&& make();

template<class T>
void sink(T);

template<class T1, class T2,
  class = decltype(sink<T2>(make<T1>()))
>
auto f(int) -> char(&)[1];

template<class, class>
auto f(...) -> char(&)[2];

static_assert(sizeof(f<decltype(nullptr), bool>(0)) != 1, "");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]