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

            Bug ID: 60952
           Summary: Problem using "end" as a type bound procedure and
                    contained procedures
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Thomas.L.Clune at nasa dot gov

Created attachment 32675
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32675&action=edit
Compile with: gfortran -c methodCalledEnd.F90

The attached reproducer shows a very simple module that generates the message:
methodCalledEnd.F90:24.15:

   function end(this) result(i)
               1
Error: VARIABLE attribute of 'end' conflicts with PROCEDURE attribute at (1)
methodCalledEnd.F90:25.18:

      integer :: i
                  1
Error: Unexpected data declaration statement in CONTAINS section at (1)
…


The message disappears if one does any of the following:
  -  the implementation of swap() is moved below end()
  -  "end" is renamed to something less "keywordish", e.g. "last"
  -  the contained procedure subSwap() is removed


Obligatory context info: 
bash-3.2$ gfortran -v methodCalledEnd.F90 
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin12/4.9.0/lto-wrapper
Target: x86_64-apple-darwin12
Configured with:
/opt/local/var/macports/build/_opt_mports_dports_lang_gcc49/gcc49/work/gcc-4.9-20140406/configure
--prefix=/opt/local --build=x86_64-apple-darwin12
--enable-languages=c,c++,objc,obj-c++,fortran,java
--libdir=/opt/local/lib/gcc49 --includedir=/opt/local/include/gcc49
--infodir=/opt/local/share/info --mandir=/opt/local/share/man
--datarootdir=/opt/local/share/gcc-4.9 --with-local-prefix=/opt/local
--with-system-zlib --disable-nls --program-suffix=-mp-4.9
--with-gxx-include-dir=/opt/local/include/gcc49/c++/ --with-gmp=/opt/local
--with-mpfr=/opt/local --with-mpc=/opt/local --with-cloog=/opt/local
--enable-cloog-backend=isl --disable-cloog-version-check
--enable-stage1-checking --disable-multilib --enable-lto
--enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld
--with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket
--with-pkgversion='MacPorts gcc49 4.9-20140406_0'
Thread model: posix
gcc version 4.9.0 20140406 (experimental) (MacPorts gcc49 4.9-20140406_0)

Reply via email to