public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "resume755 at mail dot ru" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/38501] New: typedef confuses the name of the template and the name of result Date: Fri, 12 Dec 2008 01:42:00 -0000 [thread overview] Message-ID: <bug-38501-17068@http.gcc.gnu.org/bugzilla/> (raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 1451 bytes --] typedef confuses the name of the template and the name of result: sh-3.2$ cat tloop_iterator.h #ifndef TLOOP_ITERATOR_H_ #define TLOOP_ITERATOR_H_ #include <list> template<typename T> struct loop_iterator : public T::iterator { }; template <typename T> struct list : std::list<T> { typedef loop_iterator<list> loop_iterator; }; #endif Compiling this file: sh-3.2$ g++-4.1 tloop_iterator.h sh-3.2$ g++-4.2 tloop_iterator.h all right, but: sh-3.2$ g++-4.3 tloop_iterator.h tloop_iterator.h:14: error: declaration of typedef struct loop_iterator<list<T> > list<T>::loop_iterator tloop_iterator.h:8: error: changes meaning of loop_iterator from struct loop_iterator<list<T> > sh-3.2$ g++-4.3 --version g++-4.3 (Debian 4.3.2-1) 4.3.2 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. My system is Debian GLU/Linux Lenny Version 4.3.1 also has this problem -- Summary: typedef confuses the name of the template and the name of result Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: resume755 at mail dot ru http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38501
next reply other threads:[~2008-12-12 1:42 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-12-12 1:42 resume755 at mail dot ru [this message] 2008-12-12 1:43 ` [Bug c++/38501] " resume755 at mail dot ru 2008-12-12 1:49 ` pinskia at gcc dot gnu dot org
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=bug-38501-17068@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).