public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3351: GCC 3.0 does not compile template-friend in nested template-struct.
@ 2001-06-21 17:56 whiskey
0 siblings, 0 replies; 2+ messages in thread
From: whiskey @ 2001-06-21 17:56 UTC (permalink / raw)
To: gcc-gnats
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1750 bytes --]
>Number: 3351
>Category: c++
>Synopsis: GCC 3.0 does not compile template-friend in nested template-struct.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Jun 21 17:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Jens Lindström
>Release: 3.0
>Organization:
Opera Software
>Environment:
System: Linux tooth 2.4.3-xfs-1.0 #3 Wed May 2 22:56:26 CEST 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-3.0/configure --sysconfdir=/etc --localstatedir=/var --prefix=/usr/pkg/gcc-3.0 --enable-threads --enable-languages=c++
>Description:
The following code works correctly:
#include <iostream>
using namespace std;
template <class T> struct s;
template <class T>
ostream& operator<<(ostream &o, const typename s<T>::t &x)
{
return o;
}
template <class T>
struct s {
struct t
{
friend ostream&
operator<<<T>(ostream&, const typename s<T>::t &);
};
t x;
};
int main()
{
s<int>::t y;
cout << y;
}
but if the member 'x' in 'struct s' is removed, the compliler issues the following
error:
templ.cc: In instantiation of `s<int>::t':
templ.cc:24: instantiated from here
templ.cc:17: `Ã %@Ã Â@' redeclared as different kind of symbol
templ.cc:17: sorry, not implemented: `integer_cst' not supported by dump_decl
cc1plus: previous declaration of `<declaration error>'
templ.cc:17: confused by earlier errors, bailing out
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c++/3351: GCC 3.0 does not compile template-friend in nested template-struct.
@ 2001-08-12 1:16 gdr
0 siblings, 0 replies; 2+ messages in thread
From: gdr @ 2001-08-12 1:16 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, gdr, nobody, whiskey
Synopsis: GCC 3.0 does not compile template-friend in nested template-struct.
Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: gdr
Responsible-Changed-When: Sun Aug 12 01:16:08 2001
Responsible-Changed-Why:
Analyzed.
State-Changed-From-To: open->closed
State-Changed-By: gdr
State-Changed-When: Sun Aug 12 01:16:08 2001
State-Changed-Why:
Fixed in GCC-3.0.1
-- Gaby
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3351&database=gcc
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-12 1:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-21 17:56 c++/3351: GCC 3.0 does not compile template-friend in nested template-struct whiskey
2001-08-12 1:16 gdr
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).