public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/14389] New: Can't define inline overloaded template function members out of their class. Date: Tue, 02 Mar 2004 19:14:00 -0000 [thread overview] Message-ID: <20040302191442.14389.fasbjx@free.fr> (raw) Environment: System: Linux alpha.tchume.net 2.6.3 #1 SMP Fri Feb 27 15:52:02 UTC 2004 x86_64 GNU/Linux Architecture: x86_64 host: i486-pc-linux-gnu build: i486-pc-linux-gnu target: i486-pc-linux-gnu configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux How-To-Repeat: Compile fine: #include <iostream> struct S { template< typename _B, typename _A > inline void foo() { std::cout << "AB\n"; } template< typename _A > inline void foo() { std::cout << "A\n"; } }; int main() { S s; s.foo< void >(); s.foo< void, void >(); } Don't compile: struct S { template< typename _B, typename _A > inline void foo(); template< typename _A > inline void foo(); }; template< typename _A > inline void S::foo() { std::cout << "A\n"; } template< typename _B, typename _A > inline void S::foo() { std::cout << "AB\n"; } int main() { S s; s.foo< void >(); s.foo< void, void >(); } ICE(in tsubst, at cp/pt.c:6762): struct S { template< typename _A > inline void foo(); template< int _i > inline void foo(); }; // struct S template< typename _A > inline void S::foo() { std::cout << "A\n"; } template< int _i > inline void foo() { std::cout << "const\n"; }; int main() { S s; s.foo< 0 >(); s.foo< void >(); } -- Summary: Can't define inline overloaded template function members out of their class. Product: gcc Version: 3.3 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: fasbjx at free dot fr CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i486-pc-linux-gnu GCC host triplet: i486-pc-linux-gnu GCC target triplet: i486-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14389
next reply other threads:[~2004-03-02 19:14 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-03-02 19:14 gcc-bugzilla at gcc dot gnu dot org [this message] 2004-03-02 19:49 ` [Bug c++/14389] " bangerth at dealii dot org 2004-03-02 19:52 ` [Bug c++/14389] Out-of-line of overloaded template rejected bangerth at dealii dot org 2004-03-02 20:25 ` pinskia at gcc dot gnu dot org 2004-03-03 13:44 ` giovannibajo at libero dot it 2004-03-03 13:44 ` giovannibajo at libero dot it 2004-03-03 17:07 ` giovannibajo at libero dot it 2004-03-03 18:26 ` giovannibajo at libero dot it 2004-05-03 10:11 ` cvs-commit at gcc dot gnu dot org 2004-05-03 10:16 ` giovannibajo at libero dot it
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=20040302191442.14389.fasbjx@free.fr \ --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).