re PR c++/65043 (Expected narrowing conversion during list initialization of bool...
authorMarek Polacek <polacek@redhat.com>
Tue, 21 Aug 2018 15:25:17 +0000 (15:25 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 21 Aug 2018 15:25:17 +0000 (15:25 +0000)
commit992931ba3d02d107b3abf51781b4b4625d2cce7c
tree671d641b6208764e364a009dbd4bbc0ae066d46b
parentd3e993e9b0774326a86836924eff2ddd3511d4a2
re PR c++/65043 (Expected narrowing conversion during list initialization of bool from double)

PR c++/65043
* call.c (standard_conversion): Set check_narrowing.
* typeck2.c (check_narrowing): Use CP_INTEGRAL_TYPE_P rather
than comparing with INTEGER_TYPE.

* g++.dg/concepts/pr67595.C: Add dg-warning.
* g++.dg/cpp0x/Wnarrowing11.C: New test.
* g++.dg/cpp0x/Wnarrowing12.C: New test.
* g++.dg/cpp0x/rv-cast5.C: Add static_cast.

From-SVN: r263739
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/concepts/pr67595.C
gcc/testsuite/g++.dg/cpp0x/Wnarrowing11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/Wnarrowing12.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/rv-cast5.C