public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18286] New: templates with multipile inheritence fail compile
@ 2004-11-03 11:08 amir at spinux dot com
  2004-11-03 12:17 ` [Bug c++/18286] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: amir at spinux dot com @ 2004-11-03 11:08 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-05 19:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-03 11:08 [Bug c++/18286] New: templates with multipile inheritence fail compile amir at spinux dot com
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

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).