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

           Summary: [OOP] Invalid INTENT in overriding TBP not detected
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: sfilipp...@uniroma2.it


Hello,
The attached code looks invalid to me (and to the NAG and XLF compilers), but
is accepted by gnu fortran. 

[sfilippo@localhost bug33]$ gfortran -v 
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gnu46/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc/configure --prefix=/usr/local/gnu46
--enable-languages=c,c++,fortran --with-gmp=/home/travel/GCC/BUILDS/gmp
--with-mpfr=/home/travel/GCC/BUILDS/mpfr --with-mpc=/home/travel/GCC/BUILDS/mpc 
Thread model: posix
gcc version 4.6.0 20110225 (experimental) (GCC)

[sfilippo@localhost bug33]$ gfortran -c try_ext.f90 
[sfilippo@localhost bug33]$ 

----------------
[sfilippo@localhost bug33]$ nagfor -c try_ext.f90 -f2003
NAG Fortran Compiler Release 5.3(826),5.2(765)
Error: try_ext.f90, line 38: Argument J of overriding type-bound procedure BAR
of type EXTFOO has a different INTENT
Errors in declarations, no further processing for EXTFOO_MOD
[NAG Fortran Compiler error termination, 1 error]

-------------------------------------------
bash-3.2$ xlf2003 -c try_ext.f90 
** foo_mod   === End of Compilation 1 ===
"try_ext.f90", line 25.27: 1514-593 (S) Dummy argument j of overridden binding
bar was declared with the INTENT(IN) attribute.  The corresponding dummy
argument of overriding binding bar must also be declared with the INTENT(IN)
attribute.
** extfoo_mod   === End of Compilation 2 ===
1501-511  Compilation failed for file try_ext.f90.

Reply via email to