[Bug fortran/47789] New: derived type with no components

eddyg_61-bugzilla at yahoo dot it gcc-bugzilla@gcc.gnu.org
Thu Feb 17 19:22:00 GMT 2011


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

           Summary: derived type with no components
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: eddyg_61-bugzilla@yahoo.it


The following program gives error in compilation
module modone
type:: one
!    integer :: b
contains
    procedure  :: f
end type
type, extends(one) :: two
    real :: a
endtype
contains
subroutine f(this)
    class(one) :: this
    print *,'F'
end subroutine

end module
program mmain
use modone
!type(two) :: wo = two(2,6.7)
type(two) :: wo = two(6.7)

call wo%f()
end program
-----------------------

type(two) :: wo = two(6.7)
                       1
Error: Invalid character in name at (1)
While after uncommenting
    integer :: b
and exchanging the comments in the two declaration
    type(two) :: wo = two(2,6.7)
    !type(two) :: wo = two(6.7)
make the program compile and run



More information about the Gcc-bugs mailing list