[Bug c++/88815] [9 Regression] is_constexpr (based on narrowing conversion and expression SFINAE) broken

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 27 20:20:00 GMT 2019


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

--- Comment #11 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Sun Jan 27 20:19:41 2019
New Revision: 268321

URL: https://gcc.gnu.org/viewcvs?rev=268321&root=gcc&view=rev
Log:
        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.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/Wnarrowing15.C
    trunk/gcc/testsuite/g++.dg/cpp0x/Wnarrowing16.C
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-decltype3.C
    trunk/gcc/testsuite/g++.dg/cpp1y/Wnarrowing1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


More information about the Gcc-bugs mailing list