From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24949 invoked by alias); 2 Mar 2013 00:07:16 -0000 Received: (qmail 24862 invoked by uid 48); 2 Mar 2013 00:06:46 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/56500] [OOP] "IMPLICIT CLASS(...)" wrongly rejected Date: Sat, 02 Mar 2013 00:07: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: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus 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: CC 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: 2013-03/txt/msg00107.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56500 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #1 from Tobias Burnus 2013-03-02 00:06:45 UTC --- The problem seems to be that "class_ok" is not true; the reason seems to be that gfc_build_class_symbol does not get called. I am not sure, when it has to be called but it currently fails for: implicit class(*) (a-z) allocatable :: foo end and for subroutine foo(x) implicit class(*) (a-z) end The error message is printed in resolve.c's resolve_fl_var_and_proc: /* Constraints on polymorphic variables. */ ... if (!sym->attr.class_ok && !sym->attr.use_assoc && !sym->assoc) { gfc_error ("CLASS variable '%s' at %L must be dummy, allocatable " "or pointer", sym->name, &sym->declared_at); gfc_build_class_symbol is currently only called in decl.c via "build_struct" and via attr_decl1. One probably has to call it in symbol.c's gfc_set_default_type