public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58857] New: [OOP] CLASS wrongly rejected in BLOCK DATA
@ 2013-10-23 21:31 burnus at gcc dot gnu.org
2013-10-29 23:06 ` [Bug fortran/58857] " burnus at gcc dot gnu.org
2013-12-14 17:06 ` janus at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-23 21:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58857
Bug ID: 58857
Summary: [OOP] CLASS wrongly rejected in BLOCK DATA
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: burnus at gcc dot gnu.org
Found when working on PR 44350.
The following code is rejected by gfortran, but it seems to be valid:
BLOCK DATA valid
class(*) :: zz
pointer :: zz
END BLOCK DATA valid
gfortran prints 4 times the bogus:
pointer :: zz
1
Error: PRIVATE attribute not allowed in BLOCK DATA program unit at (1)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/58857] [OOP] CLASS wrongly rejected in BLOCK DATA
2013-10-23 21:31 [Bug fortran/58857] New: [OOP] CLASS wrongly rejected in BLOCK DATA burnus at gcc dot gnu.org
@ 2013-10-29 23:06 ` burnus at gcc dot gnu.org
2013-12-14 17:06 ` janus at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-29 23:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58857
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
I tried compiling the code of comment 0 with different compilers. Result:
* Cray ftn simply compiled it.
* Portland Group's pgf90 rejected it with the bogus:
PGF90-S-0155-Polymorphic variable must be a pointer, allocatable, or dummy
object - zz
* Intel accepted it but warns:
remark #7784: Symbol in BLOCK DATA program unit is not in a COMMON block.[ZZ]
(I think it would be useful to have a similar warning as ifort, but that's a
different issue.)
>From Fortran 2008 (11.3) for BLOCK DATA:
C1116 (R1120) A block-data specification-part shall contain only definitions of
derived-type definitions and ASYNCHRONOUS, BIND, COMMON, DATA, DIMENSION,
EQUIVALENCE, IMPLICIT, INTRINSIC, PARAMETER, POINTER, SAVE, TARGET, USE,
VOLATILE, and type declaration statements.
C1117 (R1120) A type declaration statement in a block-data specification-part
shall not contain ALLOCATABLE, EXTERNAL, or BIND attribute specifiers.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug fortran/58857] [OOP] CLASS wrongly rejected in BLOCK DATA
2013-10-23 21:31 [Bug fortran/58857] New: [OOP] CLASS wrongly rejected in BLOCK DATA burnus at gcc dot gnu.org
2013-10-29 23:06 ` [Bug fortran/58857] " burnus at gcc dot gnu.org
@ 2013-12-14 17:06 ` janus at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: janus at gcc dot gnu.org @ 2013-12-14 17:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58857
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-12-14
CC| |janus at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from janus at gcc dot gnu.org ---
The whole idea of using CLASS(*) with BLOCK DATA is rather sick if you ask me
;)
Anyway, here is a draft patch which helps to allow this bestiality (not
regtested):
Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c (revision 205983)
+++ gcc/fortran/class.c (working copy)
@@ -644,7 +644,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_a
if (!gfc_add_component (fclass, "_vptr", &c))
return false;
c->ts.type = BT_DERIVED;
- if (delayed_vtab
+ if (delayed_vtab || ts->u.derived->attr.unlimited_polymorphic
|| (ts->u.derived->f2k_derived
&& ts->u.derived->f2k_derived->finalizers))
c->ts.u.derived = NULL;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-14 17:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-23 21:31 [Bug fortran/58857] New: [OOP] CLASS wrongly rejected in BLOCK DATA burnus at gcc dot gnu.org
2013-10-29 23:06 ` [Bug fortran/58857] " burnus at gcc dot gnu.org
2013-12-14 17:06 ` janus at gcc dot gnu.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).