PR target/83368
[official-gcc.git] / gcc / testsuite / gfortran.dg / common_9.f90
bloba567eb386f95c1c8e1ac1c008401324ce7e66d21
1 ! { dg-do compile }
2 ! { dg-options "-std=f95" }
4 ! PR fortran/25062
6 ! F95: 14.1.2.1:
7 ! "A common block name in a scoping unit also may be the name of any local
8 ! entity other than a named constant, intrinsic procedure, or a local variable
9 ! that is also an external function in a function subprogram."
11 ! F2003: 16.2.1
12 ! "A name that identifies a common block in a scoping unit shall not be used
13 ! to identify a constant or an intrinsic procedure in that scoping unit. If
14 ! a local identifier is also the name of a common block, the appearance of
15 ! that name in any context other than as a common block name in a COMMON
16 ! or SAVE statement is an appearance of the local identifier."
18 function func1() result(res)
19 implicit none
20 real res, r
21 common /res/ r ! { dg-error "is also a function result" }
22 end function func1
23 end