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

           Summary: Double colon in procedure-stmt (generic interface)
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: eh.toussa...@gmail.com


In Fortran 2008 the (module) procedure statement in a generic
interface can contain a double colon, according to R1206:

R1206  procedure-stmt   is   [ MODULE ] PROCEDURE [ :: ] procedure-name-list

When I try to compile the following module with gfortran 4.7-20110423
I get an error.

module m1
  implicit none
  interface foo
     module procedure :: bar
  end interface
contains
  subroutine bar
  end subroutine
end module

$ gfortran -c -std=f2008 m1.f90
m1.f90:4.23:

     module procedure :: bar
                      1
Error: Syntax error in MODULE PROCEDURE statement at (1)

(The '1' indicates the double colon as the location of the error.)

If I remove the double colon the file compiles without error - which is
expected, as the optional double colon didn't appear in the rule in previous
versions of the standard.

$ gcc -v
Using built-in specs.
COLLECT_GCC=d:\Programs\MinGW\gcc47\bin\gcc.exe
COLLECT_LTO_WRAPPER=d:/programs/mingw/gcc47/bin/../libexec/gcc/i686-pc-mingw32/4
.7.0/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ../src/configure --prefix=/mingw --with-gmp=/mingw
--with-mpfr=
/mingw --with-mpc=/mingw --disable-nls --enable-languages=c,c++,fortran
--enable
-libgomp --disable-win32-registry
Thread model: win32
gcc version 4.7.0 20110423 (experimental) (GCC)

Reply via email to