From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29544 invoked by alias); 6 Nov 2012 17:58:55 -0000 Received: (qmail 29443 invoked by uid 48); 6 Nov 2012 17:58:38 -0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/54756] [OOP] [F08] Should reject CLASS, intent(out) in PURE procedures Date: Tue, 06 Nov 2012 17:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg00502.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54756 --- Comment #4 from janus at gcc dot gnu.org 2012-11-06 17:58:36 UTC --- Draft patch: Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (revision 193224) +++ gcc/fortran/resolve.c (working copy) @@ -419,6 +419,16 @@ resolve_formal_arglist (gfc_symbol *proc) &sym->declared_at); } } + + /* F08:C1278a. */ + if (sym->ts.type == BT_CLASS && sym->attr.intent == INTENT_OUT + && (gfc_option.allow_std & GFC_STD_F2008) != 0) + { + gfc_error ("INTENT(OUT) argument '%s' of pure procedure '%s' " + "at %L may not be polymorphic in Fortran 2008", + sym->name, proc->name, &sym->declared_at); + continue; + } } if (proc->attr.implicit_pure) Unfortunately, we cannot use 'gfc_notify_std' here (or we would need to add something like GFC_STD_F2008_DEL, although this is not officially a 'deleted feature', I guess). So, we could just go with the above, or alternatively reject it regardless of the chosen standard. This 'feature' probably counts as an 'oversight' which was missed in F03 and added to F08 only in a corrigendum.