This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/30875] Equivalence of derived types with (same) default initializer



------- Comment #1 from burnus at gcc dot gnu dot org  2007-02-20 16:39 -------
EQUIVALENCE(a1,a2)
             1
Error: Derived type variable 'a1' at (1) with default initializer cannot be an
EQUIVALENCE object
ffv.f90:11.17:

EQUIVALENCE(a1,a2)
                1
Error: Initialized objects 'a1' and 'a2' cannot both be in the EQUIVALENCE
statement at (1)

Compiles with ifort, g95 and nagf95.


Observations:

If T1 is initialized with "1" and T2 with "2", ifort and nag95 compile it and
g95 rejects it with:
"Memory is initialized more than once (offset 0)"

If run (both "1"):
g95:  1  1 
nagf95: garbage value (twice)
ifort: 1 1

If run with "1", "2":
g95: - (does not compile, see above)
ifort: 2 2
nagf95: garbage value (twice)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
            Summary|incorrect error message for |Equivalence of derived types
                   |valid code                  |with (same) default
                   |                            |initializer


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30875


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]