]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR c++/88815 - narrowing conversion lost in decltype.
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Jan 2019 20:19:41 +0000 (20:19 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Jan 2019 20:19:41 +0000 (20:19 +0000)
commitb7feeacee2d7d7a97107684b8d808b635667f263
tree303d78bfca602c2ab5f6769b662b99ffebfb6f37
parent1d41b42f5f7e805e6afdb715156a6cf19479a002
PR c++/88815 - narrowing conversion lost in decltype.
PR c++/78244 - narrowing conversion in template not detected.
* cp-tree.h (CONSTRUCTOR_IS_DEPENDENT): New.
* pt.c (instantiation_dependent_r): Consider a CONSTRUCTOR with
CONSTRUCTOR_IS_DEPENDENT instantiation-dependent.
* semantics.c (finish_compound_literal): When the compound literal
isn't instantiation-dependent and the type isn't type-dependent,
fall back to the normal processing.  Set CONSTRUCTOR_IS_DEPENDENT.

* g++.dg/cpp0x/Wnarrowing15.C: New test.
* g++.dg/cpp0x/Wnarrowing16.C: New test.
* g++.dg/cpp0x/constexpr-decltype3.C: New test.
* g++.dg/cpp1y/Wnarrowing1.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268321 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/Wnarrowing15.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/Wnarrowing16.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-decltype3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp1y/Wnarrowing1.C [new file with mode: 0644]