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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |7.4.0
   Target Milestone|---                         |8.4
            Summary|is_constructible_v<int[]>   |[8/9/10 Regression]
                   |and                         |is_constructible_v<int[]>
                   |is_default_constructible_v< |and
                   |int[]> should agree         |is_default_constructible_v<
                   |                            |int[]> should agree
      Known to fail|                            |10.0, 8.1.0, 8.3.0, 9.1.0

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is a regression due to the addition of the __is_constructible built-in.
Before we had that, this correct test passed:

#include <type_traits>

static_assert( !std::is_constructible<int[]>::value, "");
static_assert( !std::is_default_constructible<int[]>::value, "");

static_assert( !std:: is_trivially_constructible<int[]>::value, "");
static_assert( !std::is_trivially_default_constructible<int[]>::value, "");

Now three out of four assertions fail, because they use the built-in.

I'm testing this fix:

--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1201,6 +1201,8 @@ is_xible_helper (enum tree_code code, tree to, tree from,
bool trivial)
     expr = assignable_expr (to, from);
   else if (trivial && from && TREE_CHAIN (from))
     return error_mark_node; // only 0- and 1-argument ctors can be trivial
+  else if (TREE_CODE(to) == ARRAY_TYPE && !TYPE_DOMAIN (to))
+    return error_mark_node; // can't construct an array of unknown bound
   else
     expr = constructible_expr (to, from);
   return expr;

Reply via email to