From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31780 invoked by alias); 12 Apr 2002 21:46:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 31729 invoked by uid 71); 12 Apr 2002 21:46:01 -0000 Resent-Date: 12 Apr 2002 21:46:01 -0000 Resent-Message-ID: <20020412214601.31728.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, joerg@eyematic.com Received:(qmail 27026 invoked by uid 61); 12 Apr 2002 21:37:24 -0000 Message-Id:<20020412213724.27025.qmail@sources.redhat.com> Date: Fri, 12 Apr 2002 14:46:00 -0000 From: joerg@eyematic.com Reply-To: joerg@eyematic.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/6283: iterator type definitions not accessible in derived template classes X-SW-Source: 2002-04/txt/msg00674.txt.bz2 List-Id: >Number: 6283 >Category: c++ >Synopsis: iterator type definitions not accessible in derived template classes >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Apr 12 14:46:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: joerg@eyematic.com >Release: g++-3.0.3 >Organization: >Environment: i686-pc-linux-gnu >Description: The following code does not compile. The problem is the iterator used in the print() function. After close examination, we noticed that if we explicitely define the iterator with a typedef as is done in std_list.h for the list template definition, the problem goes away. Here the example: ======================================================== #include #include using namespace std; template class my_list : public list { public: void print() const; }; template void my_list::print() const { list::const_iterator i; for( i = begin(); i != end(); i++ ) { cout << *i; } } /**/ int main() { my_list l; l.push_back( 1 ); l.print(); } >How-To-Repeat: To reproduce the problem, compile with g++ -pedantic t.cpp -o t where t.cpp contains the example code above. >Fix: >Release-Note: >Audit-Trail: >Unformatted: