public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/6284: iterator type definitions not accessible in derived template classes
@ 2002-04-12 14:58 pme
  0 siblings, 0 replies; 2+ messages in thread
From: pme @ 2002-04-12 14:58 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, joerg, nobody

Synopsis: iterator type definitions not accessible in derived template classes

State-Changed-From-To: open->closed
State-Changed-By: pme
State-Changed-When: Fri Apr 12 14:58:56 2002
State-Changed-Why:
    Duplicate of 6283.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6284


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/6284: iterator type definitions not accessible in derived template classes
@ 2002-04-12 14:46 joerg
  0 siblings, 0 replies; 2+ messages in thread
From: joerg @ 2002-04-12 14:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6284
>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:01 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 <iostream>
#include <list>
using namespace std;

template <class type>
class my_list : public list<type>
{
public:
	void print() const;
};

template <class type>
void my_list<type>::print() const
{
	list<type>::const_iterator i;
	for( i = begin(); i != end(); i++ )
	{
		cout << *i;
	}
}


/**/

int main()
{
	my_list<int> 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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-12 21:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-12 14:58 c++/6284: iterator type definitions not accessible in derived template classes pme
  -- strict thread matches above, loose matches on Subject: below --
2002-04-12 14:46 joerg

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).