Skip to content

Commit 398477b

Browse files
committed
New gfortran bug test case
1 parent 7c074a4 commit 398477b

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

gfortran-bugs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ include(testing)
55

66
project(gfortran-bug Fortran)
77

8+
add_compiler_test(SOURCES gfortran-20200501.f90 COMPILE_ONLY LABELS PR94909)
89
add_compiler_test(SOURCES gfortran-20200402-file1.f90 gfortran-20200402-file2.f90
910
LINK_ONLY LABELS PR94463)
1011
add_compiler_test(SOURCES gfortran-20190202.f90 RUN_ONLY LABELS PR89174)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
!! https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94909
2+
!!
3+
!! REJECTS VALID CODE
4+
!!
5+
!! There is no recursion here.
6+
!!
7+
!! $ gfortran --version
8+
!! GNU Fortran (GCC) 9.3.0
9+
!!
10+
!! $ gfortran -c gfortran-20200501.f90
11+
!! gfortran-20200501.f90:13:10:
12+
!!
13+
!! 13 | dot = a%dot_(b)
14+
!! | 1
15+
!! Error: Function 'dot' at (1) cannot be called recursively, as it is not RECURSIVE
16+
!!
17+
18+
module example
19+
20+
type, abstract :: foo
21+
contains
22+
procedure :: dot
23+
procedure(dot), deferred :: dot_
24+
end type
25+
26+
contains
27+
28+
function dot(a, b)
29+
class(foo) :: a, b
30+
dot = a%dot_(b)
31+
end function
32+
33+
end module

0 commit comments

Comments
 (0)