File tree Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Expand file tree Collapse file tree 2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ include(testing)
55
66project (nag-bug Fortran)
77
8- add_compiler_test(SOURCES nag-20200110.f90 RUN_ONLY COMPILE_FLAGS "-O" )
8+ add_compiler_test(SOURCES nag-20200124.f90 COMPILE_ONLY LABELS SR104818)
9+ add_compiler_test(SOURCES nag-20200110.f90 RUN_ONLY COMPILE_FLAGS "-O" LABELS SR104737)
910add_compiler_test(SOURCES nag-20190906.f90 RUN_ONLY LABELS SR104066)
1011add_compiler_test(SOURCES nag-20190831.f90 RUN_ONLY LABELS SR104066)
1112add_compiler_test(SOURCES nag-20190826a.f90 COMPILE_ONLY LABELS SR104042)
Original file line number Diff line number Diff line change 1+ ! ! SR104818
2+ ! !
3+ ! ! GENERIC FUNCTION LOSES CONTIGUOUS ATTRIBUTE
4+ ! !
5+ ! ! The following example shows that the CONTIGUOUS attribute of an
6+ ! ! array pointer valued function is not being propagated to the
7+ ! ! generic function for which it is a specific procedure in some
8+ ! ! contexts. The error occurs for both 6.2 and 7.0, but not 6.1
9+ ! !
10+ ! ! $ nagfor -w nag-20200124.f90
11+ ! ! NAG Fortran Compiler Release 6.2(Chiyoda) Build 6253
12+ ! ! Error: nag-20200124.f90, line 34: Argument DP (no. 1) of FOO is a CONTIGUOUS
13+ ! ! pointer, but the actual argument is not simply contiguous
14+ ! ! [NAG Fortran Compiler error termination, 1 error, 1 warning]
15+ ! !
16+
17+ module contig_generic_ptr_func
18+
19+ interface dataptr
20+ procedure dataptr1
21+ end interface
22+
23+ contains
24+
25+ function dataptr1 () result(dp)
26+ real , pointer , contiguous :: dp(:)
27+ allocate (dp(10 ))
28+ end function
29+
30+ end module
31+
32+ use contig_generic_ptr_func
33+ real , pointer , contiguous :: x(:)
34+ x = > dataptr() ! NO ERROR HERE
35+ call foo(dataptr1()) ! NO ERROR HERE
36+ call foo(dataptr()) ! BUT ERROR HERE
37+ contains
38+ subroutine foo (dp )
39+ real , pointer , contiguous :: dp(:)
40+ end subroutine
41+ end
You can’t perform that action at this time.
0 commit comments