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

kargl at gcc dot gnu.org changed:

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

--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to anlauf from comment #3)
> Created attachment 53601 [details]
> Hackish patch
> 
> This patch fixes all ICE in comment#0 and comment#1.
> However, it papers over the issue that we forget about
> earlier errors: while
> 
>   print *,     [real :: -'1']
> 
> is diagnosed for the invalid unary "-",
> 
>   print *, 2 * [real :: -'1']
> 
> will throw a different error.
> So I'm not really happy with the hack.

I think we need to expand the checking in array.cc

  /* Convert components of an array constructor to the type in ts.  */

  static match
  walk_array_constructor (gfc_typespec *ts, gfc_constructor_base head)

I haven't had time to look deeper, but this function should be comparing
the typespecs of REAL and -'1' or +'1'.  That should fail.  I suspect that
the EXPR_OP of type_expr is allowing the array constructor walk to succeed.

Reply via email to