aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorAndrew Benson <abenson@carnegiescience.edu>2020-02-10 17:59:34 +0000
committerAndrew Benson <abenson@carnegiescience.edu>2020-02-10 17:59:34 +0000
commit7848054c68bad6e2aa40cb59f77cc99bd8448d52 (patch)
treec445cff040dd021e8ab81d9fd5d5e2e0139c03f5 /gcc/testsuite/gfortran.dg
parent0cc575e4d8b68b743e07da02a74733f9b5cb585a (diff)
downloadgcc-7848054c68bad6e2aa40cb59f77cc99bd8448d52.zip
gcc-7848054c68bad6e2aa40cb59f77cc99bd8448d52.tar.gz
gcc-7848054c68bad6e2aa40cb59f77cc99bd8448d52.tar.bz2
Fix bogus duplicate attribute errors for submodule functions.
PR fortran/83113 * array.c: Do not attempt to set the array spec for a submodule function symbol (as it has already been set in the corresponding module procedure interface). * symbol.c: Do not reject duplicate POINTER, ALLOCATABLE, or DIMENSION attributes in declarations of a submodule function. * gfortran.h: Add a macro that tests for a module procedure in a submodule. * gfortran.dg/pr83113.f90: New test.
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/pr83113.f9018
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr83113.f90 b/gcc/testsuite/gfortran.dg/pr83113.f90
new file mode 100644
index 0000000..7dbe802
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr83113.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! PR fortran/83113
+module mm
+ implicit none
+ interface
+ module function c()
+ integer, dimension(2) :: c
+ end function c
+ end interface
+end module mm
+
+submodule (mm) oo
+ implicit none
+contains
+ module function c()
+ integer, dimension(3) :: c
+ end function c
+end submodule oo