public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "amir at spinux dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/18286] New: templates with multipile inheritence fail compile Date: Wed, 03 Nov 2004 11:08:00 -0000 [thread overview] Message-ID: <20041103110839.18286.amir@spinux.com> (raw) There seems to be a problem with multipile inheritence and template the attached code compile on gcc 3.2.2 and fail on gcc 3.4.2 the same code with only one inheritace (delete class c) pass compile compiler version c++ -v Reading specs from /insightix/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.2/specs Configured with: ../configure --prefix=/insightix/local/ Thread model: posix gcc version 3.4.2 gcc build configuration options ../configure --prefix=/usr/local/gcc_test c++ test.cpp In file included from test.cpp:2: test.h: In constructor `c<T, R>::c()': test.h:23: error: `int_b' undeclared (first use this function) test.h:23: error: (Each undeclared identifier is reported only once for each function it appears in.) test.h:23: error: `int_a' undeclared (first use this function) test.cpp #include "test.h" int main(void){ c<int,int> class_c; return 0; } test.h #ifndef __TEST_H #define __TEST_H class a{ public: int int_a; a() {int_a = 0;} ~a() {}; }; template<class T, class R> class b: public a{ public: int int_b; b<T,R>() {int_b = 0; int_a = 1;} }; template<class T, class R> class c: public b<T,R>{ public: int int_c; c<T,R>() {int_c = 0; int_b = 1; int_a = 2;} }; #endif -- Summary: templates with multipile inheritence fail compile Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: amir at spinux dot com CC: gcc-bugs at gcc dot gnu dot org GCC host triplet: x86 GCC target triplet: x86 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18286
next reply other threads:[~2004-11-03 11:08 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-11-03 11:08 amir at spinux dot com [this message] 2004-11-03 12:17 ` [Bug c++/18286] " pinskia at gcc dot gnu dot org 2004-11-05 19:28 ` bangerth at dealii dot org 2004-11-05 19:31 ` bangerth at dealii 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=20041103110839.18286.amir@spinux.com \ --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).