[Bug fortran/84432] [F08] Detect illegal component initialization in pdt_27.f03

2018-02-24 Thread neil.n.carlson at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84432

--- Comment #6 from Neil Carlson  ---
... and this would also be invalid

   type t(a)
  integer, len :: a = 3
  character(len=a) :: c = 'foo'
   end type

[Bug fortran/84432] [F08] Detect illegal component initialization in pdt_27.f03

2018-02-24 Thread neil.n.carlson at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84432

--- Comment #5 from Neil Carlson  ---
No, both of those are valid. The constraint is on component initialization, and
type parameters are *not* components.  So something like this would be invalid
by F08:C458

   type t(a)
  integer, len :: a
  character(len=a) :: c = 'foo'
   end type

[Bug fortran/84432] [F08] Detect illegal component initialization in pdt_27.f03

2018-02-24 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84432

Jerry DeLisle  changed:

   What|Removed |Added

 CC||jvdelisle at gcc dot gnu.org

--- Comment #4 from Jerry DeLisle  ---
Just to clarify.  Are you saying that this: invalid

   type t(a)
  integer, len :: a
  character(len=a) :: c
   end type

should be: valid

   type t(a)
  integer, len :: a = 2
  character(len=a) :: c
   end type

a is a parameter and c is a component.

?

Some of the I/O touches on pr84143.

[Bug fortran/84432] [F08] Detect illegal component initialization in pdt_27.f03

2018-02-18 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84432

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-02-18
 Ever confirmed|0   |1

--- Comment #3 from Dominique d'Humieres  ---
From the activity I guess this PR is confirmed.

[Bug fortran/84432] [F08] Detect illegal component initialization in pdt_27.f03

2018-02-18 Thread neil.n.carlson at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84432

Neil Carlson  changed:

   What|Removed |Added

 CC||neil.n.carlson at gmail dot com

--- Comment #2 from Neil Carlson  ---
One of the corrigenda to F2003 (https://wg5-fortran.org/N1801-N1850/N1823.pdf)
added C447a:

"If component-initialization appears, every type parameter and array
bound of the component shall be an initialization expression."

Corresponds to F08:C458, except "initialization" replaces "colon or constant".
Not sure if there is anything significant between the two (probably is).

[Bug fortran/84432] [F08] Detect illegal component initialization in pdt_27.f03

2018-02-17 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84432

janus at gcc dot gnu.org changed:

   What|Removed |Added

Summary|Detect illegal component|[F08] Detect illegal
   |initialization in   |component initialization in
   |pdt_27.f03  |pdt_27.f03

--- Comment #1 from janus at gcc dot gnu.org ---
(In reply to janus from comment #0)
> pdt_27.f03 is illegal wrt F08:C458.

That constraint seems to be missing in F03 AFAICS. I find the neighboring
clauses (C457/459) as C446/447 in F03, but not F08:C458.