public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47876] New: Host-assoc generic subroutine plus intrinsic function not rejected
@ 2011-02-24 7:34 burnus at gcc dot gnu.org
2015-10-10 9:44 ` [Bug fortran/47876] " dominiq at lps dot ens.fr
0 siblings, 1 reply; 2+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-02-24 7:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47876
Summary: Host-assoc generic subroutine plus intrinsic function
not rejected
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/8e0240bbb7628ce2
Steve Lionel claims the code is invalid and NAG also rejects it, which is a
good indication that it is indeed invalid - even though at a glance I thought
the code is valid.
gfortran compiles the following without warning or error:
module hostassoc
implicit none
interface pack
module procedure pack_sub
end interface
contains
subroutine pack_sub ()
end subroutine pack_sub
subroutine foo (a)
integer, intent(in) :: a(:)
! intrinsic :: pack ! Try uncommenting this line...
print *, pack (a, a /= 0)
end subroutine foo
end module hostassoc
Steve wrote:
The key to this is paragraph number 5 on p286 of F2008 (12.4.3.4.5
Restrictions on generic declarations). It says:
Within the scope of a generic name that is the same as the generic name
of an intrinsic procedure, the intrinsic procedure is not accessible by
its generic name if the procedures in the interface and the intrinsic
procedure are not all functions or not all subroutines.
In your case with the INTRINSIC commented out, the PACK intrinsic is
made inaccessible because your generic PACK has a subroutine as one of
the interfaces. Since the intrinsic is inaccessible, the reference to
PACK as a function fails.
If you uncomment the INTRINSIC, then you are violating constraint C1215
(F2008) "Within the scope of a generic name, each pair of procedures
identified by that name shall both be subroutines or both be functions"
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug fortran/47876] Host-assoc generic subroutine plus intrinsic function not rejected
2011-02-24 7:34 [Bug fortran/47876] New: Host-assoc generic subroutine plus intrinsic function not rejected burnus at gcc dot gnu.org
@ 2015-10-10 9:44 ` dominiq at lps dot ens.fr
0 siblings, 0 replies; 2+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-10-10 9:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47876
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-10-10
Ever confirmed|0 |1
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still no error at r228660.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-10 9:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-24 7:34 [Bug fortran/47876] New: Host-assoc generic subroutine plus intrinsic function not rejected burnus at gcc dot gnu.org
2015-10-10 9:44 ` [Bug fortran/47876] " dominiq at lps dot ens.fr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).