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

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Mon May 20 13:02:10 2019
New Revision: 271417

URL: https://gcc.gnu.org/viewcvs?rev=271417&root=gcc&view=rev
Log:
PR c++/90532 Ensure __is_constructible(T[]) is false

An array of an unknown bound is an incomplete type, so no object of such
a type can be constructed. This means __is_constructible should always
be false for an array of unknown bound.

This patch also changes the std::is_default_constructible trait to use
std::is_constructible, which now gives the right answer for arrays of
unknown bound.

gcc/cp:

        Backported from mainline
        2019-05-20  Jonathan Wakely  <jwak...@redhat.com>

        PR c++/90532 Ensure __is_constructible(T[]) is false
        * method.c (is_xible_helper): Return error_mark_node for construction
        of an array of unknown bound.

gcc/testsuite:

        Backported from mainline
        2019-05-20  Jonathan Wakely  <jwak...@redhat.com>

        PR c++/90532 Ensure __is_constructible(T[]) is false
        * g++.dg/ext/90532.C: New test.

libstdc++-v3:

        Backported from mainline
        2019-05-20  Jonathan Wakely  <jwak...@redhat.com>

        PR c++/90532 Ensure __is_constructible(T[]) is false
        * include/std/type_traits (__do_is_default_constructible_impl)
        (__is_default_constructible_atom, __is_default_constructible_safe):
        Remove.
        (is_default_constructible): Use is_constructible.
        * testsuite/20_util/is_constructible/value.cc: Check int[] case.
        * testsuite/20_util/is_default_constructible/value.cc: Likewise.
        * testsuite/20_util/is_trivially_constructible/value.cc: Likewise.
        * testsuite/20_util/is_trivially_default_constructible/value.cc:
        Likewise.

Added:
    branches/gcc-9-branch/gcc/testsuite/g++.dg/ext/90532.C
Modified:
    branches/gcc-9-branch/gcc/cp/ChangeLog
    branches/gcc-9-branch/gcc/cp/method.c
    branches/gcc-9-branch/gcc/testsuite/ChangeLog
    branches/gcc-9-branch/libstdc++-v3/ChangeLog
    branches/gcc-9-branch/libstdc++-v3/include/std/type_traits
   
branches/gcc-9-branch/libstdc++-v3/testsuite/20_util/is_constructible/value.cc
   
branches/gcc-9-branch/libstdc++-v3/testsuite/20_util/is_default_constructible/value.cc
   
branches/gcc-9-branch/libstdc++-v3/testsuite/20_util/is_trivially_constructible/value.cc
   
branches/gcc-9-branch/libstdc++-v3/testsuite/20_util/is_trivially_default_constructible/value.cc

Reply via email to