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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think the patch is simply

--- a/gcc/cp/semantics.cc
+++ b/gcc/cp/semantics.cc
@@ -12439,7 +12439,9 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree
type2)
       return CP_AGGREGATE_TYPE_P (type1);

     case CPTK_IS_ARRAY:
-      return type_code1 == ARRAY_TYPE;
+      return (type_code1 == ARRAY_TYPE
+         /* ??? We don't want to report T[0] as being an array type.  */
+         && !(TYPE_SIZE (type1) && integer_zerop (TYPE_SIZE (type1))));

     case CPTK_IS_ASSIGNABLE:
       return is_xible (MODIFY_EXPR, type1, type2);

but are we *sure* that we don't want to treat int[0] as an array type?  It's
not clear to me that https://github.com/llvm/llvm-project/pull/86652 reached a
consensus.

Reply via email to