public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: whiskey@i100.ryd.student.liu.se To: gcc-gnats@gcc.gnu.org Subject: c++/3351: GCC 3.0 does not compile template-friend in nested template-struct. Date: Thu, 21 Jun 2001 17:56:00 -0000 [thread overview] Message-ID: <200106220045.f5M0jPD04855@i100.ryd.student.liu.se> (raw) [-- 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:
next reply other threads:[~2001-06-21 17:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-06-21 17:56 whiskey [this message] 2001-08-12 1:16 gdr
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=200106220045.f5M0jPD04855@i100.ryd.student.liu.se \ --to=whiskey@i100.ryd.student.liu.se \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).