Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/dummy_procedure_11.f90 @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ! { dg-do compile } | |
2 ! | |
3 ! PR 60507: Passing function call into procedure argument not caught | |
4 ! | |
5 ! Contributed by Vladimir Fuka <vladimir.fuka@gmail.com> | |
6 | |
7 type :: t | |
8 procedure(g), pointer, nopass :: ppc => g | |
9 end type | |
10 | |
11 procedure(g), pointer :: pp => g | |
12 type(t)::x | |
13 | |
14 print *, f(g) | |
15 print *, f(g()) ! { dg-error "Expected a procedure for argument" } | |
16 print *, f(pp) | |
17 print *, f(pp()) ! { dg-error "Expected a procedure for argument" } | |
18 print *, f(x%ppc) | |
19 print *, f(x%ppc()) ! { dg-error "Expected a procedure for argument" } | |
20 | |
21 contains | |
22 | |
23 real function f(fun) | |
24 procedure(g) :: fun | |
25 f = fun() | |
26 end function | |
27 | |
28 real function g() | |
29 g = 1. | |
30 end function | |
31 | |
32 end |