public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40940] New: [F03] CLASS statement
@ 2009-08-02 12:19 janus at gcc dot gnu dot org
2009-08-08 16:32 ` [Bug fortran/40940] " janus at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-08-02 12:19 UTC (permalink / raw)
To: gcc-bugs
A first step towards full polymorphism in gfortran would be the parsing and
resolution of CLASS statements, as defined in section 5.1 of the Fortran 2003
standard (R502).
Such and implementation must e.g. respect C502, C509 and C437 (to name a few).
A trivial application is the use of CLASS declarations as a replacement for
TYPE, where the dynamic type equals the declared type.
--
Summary: [F03] CLASS statement
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: janus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40940
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/40940] [F03] CLASS statement
2009-08-02 12:19 [Bug fortran/40940] New: [F03] CLASS statement janus at gcc dot gnu dot org
@ 2009-08-08 16:32 ` janus at gcc dot gnu dot org
2009-08-10 9:19 ` janus at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-08-08 16:32 UTC (permalink / raw)
To: gcc-bugs
--
janus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |janus at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-08-08 16:32:25
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40940
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/40940] [F03] CLASS statement
2009-08-02 12:19 [Bug fortran/40940] New: [F03] CLASS statement janus at gcc dot gnu dot org
2009-08-08 16:32 ` [Bug fortran/40940] " janus at gcc dot gnu dot org
@ 2009-08-10 9:19 ` janus at gcc dot gnu dot org
2009-08-12 8:42 ` janus at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-08-10 9:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from janus at gcc dot gnu dot org 2009-08-10 09:19 -------
Subject: Bug 40940
Author: janus
Date: Mon Aug 10 09:19:24 2009
New Revision: 150620
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=150620
Log:
2009-08-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/40940
* decl.c (gfc_match_type_spec): Match CLASS statement and warn about
missing polymorphism.
* gfortran.h (gfc_typespec): Add field 'is_class'.
* misc.c (gfc_clear_ts): Initialize 'is_class' to zero.
* resolve.c (type_is_extensible): New function to check if a derived
type is extensible.
(resolve_fl_variable_derived): Add error checks for CLASS variables.
(resolve_typebound_procedure): Disallow non-polymorphic passed-object
dummy arguments, turning warning into error.
(resolve_fl_derived): Use 'type_is_extensible'. Disallow
non-polymorphic
passed-object dummy arguments for procedure pointer components,
turning warning into error. Add error check for CLASS components.
2009-08-10 Janus Weil <janus@gcc.gnu.org>
PR fortran/40940
* gfortran.dg/class_1.f03: New.
* gfortran.dg/class_2.f03: New.
* gfortran.dg/proc_ptr_comp_pass_1.f90: Use CLASS instead of TYPE.
* gfortran.dg/proc_ptr_comp_pass_2.f90: Ditto.
* gfortran.dg/proc_ptr_comp_pass_3.f90: Ditto.
* gfortran.dg/typebound_call_10.f03: Ditto.
* gfortran.dg/typebound_call_2.f03: Ditto.
* gfortran.dg/typebound_call_3.f03: Ditto.
* gfortran.dg/typebound_call_4.f03: Ditto.
* gfortran.dg/typebound_generic_3.f03: Ditto.
* gfortran.dg/typebound_generic_4.f03: Ditto.
* gfortran.dg/typebound_proc_1.f08: Ditto.
* gfortran.dg/typebound_proc_5.f03: Ditto.
* gfortran.dg/typebound_proc_6.f03: Ditto.
Added:
trunk/gcc/testsuite/gfortran.dg/class_1.f03
trunk/gcc/testsuite/gfortran.dg/class_2.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/misc.c
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_1.f90
trunk/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_2.f90
trunk/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_3.f90
trunk/gcc/testsuite/gfortran.dg/typebound_call_10.f03
trunk/gcc/testsuite/gfortran.dg/typebound_call_2.f03
trunk/gcc/testsuite/gfortran.dg/typebound_call_3.f03
trunk/gcc/testsuite/gfortran.dg/typebound_call_4.f03
trunk/gcc/testsuite/gfortran.dg/typebound_generic_3.f03
trunk/gcc/testsuite/gfortran.dg/typebound_generic_4.f03
trunk/gcc/testsuite/gfortran.dg/typebound_proc_1.f08
trunk/gcc/testsuite/gfortran.dg/typebound_proc_5.f03
trunk/gcc/testsuite/gfortran.dg/typebound_proc_6.f03
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40940
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/40940] [F03] CLASS statement
2009-08-02 12:19 [Bug fortran/40940] New: [F03] CLASS statement janus at gcc dot gnu dot org
2009-08-08 16:32 ` [Bug fortran/40940] " janus at gcc dot gnu dot org
2009-08-10 9:19 ` janus at gcc dot gnu dot org
@ 2009-08-12 8:42 ` janus at gcc dot gnu dot org
2009-08-16 8:39 ` janus at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-08-12 8:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from janus at gcc dot gnu dot org 2009-08-12 08:42 -------
r150620 implements simple parsing and resolution of CLASS statements, without
actual polymorphism. Some things missing for full polymorphism:
* CLASS(*)
* SELECT_TYPE
* EXTENDS_TYPE_OF
* SAME_TYPE_AS
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40940
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/40940] [F03] CLASS statement
2009-08-02 12:19 [Bug fortran/40940] New: [F03] CLASS statement janus at gcc dot gnu dot org
` (2 preceding siblings ...)
2009-08-12 8:42 ` janus at gcc dot gnu dot org
@ 2009-08-16 8:39 ` janus at gcc dot gnu dot org
2009-08-16 8:42 ` janus at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-08-16 8:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from janus at gcc dot gnu dot org 2009-08-16 08:39 -------
One thing which was forgotten in the first patch: CLASS should be rejected with
-std=f95.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40940
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/40940] [F03] CLASS statement
2009-08-02 12:19 [Bug fortran/40940] New: [F03] CLASS statement janus at gcc dot gnu dot org
` (3 preceding siblings ...)
2009-08-16 8:39 ` janus at gcc dot gnu dot org
@ 2009-08-16 8:42 ` janus at gcc dot gnu dot org
2009-08-31 19:08 ` janus at gcc dot gnu dot org
2009-08-31 19:19 ` janus at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-08-16 8:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from janus at gcc dot gnu dot org 2009-08-16 08:41 -------
class_2.f03 ICEs with -std=f95.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40940
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/40940] [F03] CLASS statement
2009-08-02 12:19 [Bug fortran/40940] New: [F03] CLASS statement janus at gcc dot gnu dot org
` (4 preceding siblings ...)
2009-08-16 8:42 ` janus at gcc dot gnu dot org
@ 2009-08-31 19:08 ` janus at gcc dot gnu dot org
2009-08-31 19:19 ` janus at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-08-31 19:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from janus at gcc dot gnu dot org 2009-08-31 19:08 -------
Subject: Bug 40940
Author: janus
Date: Mon Aug 31 19:08:03 2009
New Revision: 151244
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151244
Log:
2009-08-31 Janus Weil <janus@gcc.gnu.org>
Paul Thomas <pault@gcc.gnu.org>
PR fortran/40940
* array.c (gfc_match_array_constructor): Rename gfc_match_type_spec.
* decl.c (gfc_match_type_spec): Rename to gfc_match_decl_type_spec,
and reject CLASS with -std=f95.
(gfc_match_implicit, gfc_match_data_decl,gfc_match_prefix,
match_procedure_interface): Rename gfc_match_type_spec.
* gfortran.h (gfc_type_compatible): Add prototype.
* match.h (gfc_match_type_spec): Rename to gfc_match_decl_type_spec.
* match.c (match_intrinsic_typespec): Rename to match_type_spec, and
add handling of derived types.
(gfc_match_allocate): Rename match_intrinsic_typespec and check
type compatibility of derived types.
* symbol.c (gfc_type_compatible): New function to check if two types
are compatible.
2009-08-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/40940
* gfortran.dg/allocate_derived_1.f90: New.
* gfortran.dg/class_3.f03: New.
Added:
trunk/gcc/testsuite/gfortran.dg/allocate_derived_1.f90
trunk/gcc/testsuite/gfortran.dg/class_3.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/array.c
trunk/gcc/fortran/decl.c
trunk/gcc/fortran/gfortran.h
trunk/gcc/fortran/match.c
trunk/gcc/fortran/match.h
trunk/gcc/fortran/symbol.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40940
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/40940] [F03] CLASS statement
2009-08-02 12:19 [Bug fortran/40940] New: [F03] CLASS statement janus at gcc dot gnu dot org
` (5 preceding siblings ...)
2009-08-31 19:08 ` janus at gcc dot gnu dot org
@ 2009-08-31 19:19 ` janus at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-08-31 19:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from janus at gcc dot gnu dot org 2009-08-31 19:19 -------
r151244 fixes comment #3 and #4. The items in comment #2 have to wait for a
full implementation of polymorphism. Closing.
--
janus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40940
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-08-31 19:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-02 12:19 [Bug fortran/40940] New: [F03] CLASS statement janus at gcc dot gnu dot org
2009-08-08 16:32 ` [Bug fortran/40940] " janus at gcc dot gnu dot org
2009-08-10 9:19 ` janus at gcc dot gnu dot org
2009-08-12 8:42 ` janus at gcc dot gnu dot org
2009-08-16 8:39 ` janus at gcc dot gnu dot org
2009-08-16 8:42 ` janus at gcc dot gnu dot org
2009-08-31 19:08 ` janus at gcc dot gnu dot org
2009-08-31 19:19 ` janus at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).