c++: Implement P1957R2, T* to bool should be considered narrowing.
commit0ca22d027eccb55215bb553b66fb10637344e2e6
authorMarek Polacek <polacek@redhat.com>
Thu, 7 May 2020 15:14:51 +0000 (7 11:14 -0400)
committerMarek Polacek <polacek@redhat.com>
Thu, 7 May 2020 17:41:33 +0000 (7 13:41 -0400)
treeacb943efac6d5545437e32535fd309de96a75fb8
parentb9250b3cb91b667cd67943e0fac94bf39ac089a8
c++: Implement P1957R2, T* to bool should be considered narrowing.

This was approved in the Prague 2020 WG21 meeting so let's adjust the
comment.  Since it's supposed to be a DR I think we should no longer
limit it to C++20.

P1957R2
* typeck2.c (check_narrowing): Consider T* to bool narrowing
in C++11 and up.

* g++.dg/cpp0x/initlist92.C: Don't expect an error in C++20 only.
gcc/cp/ChangeLog
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/initlist92.C