This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16391] New: Segmentation fault when mixing inheritance, templates and friends
- From: "chgros+bugzilla at stanford dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jul 2004 18:08:19 -0000
- Subject: [Bug c++/16391] New: Segmentation fault when mixing inheritance, templates and friends
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Segmentation fault when mixing inheritance, templates and friends
gcc -v returns:
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.4/specs
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
Thread model: posix
gcc version 3.3.4 (Debian 1:3.3.4-2)
This programs leads to a segfault of the compiler:
// ------ START -------
class A{};
template<typename pat1>
class B: public A
{
public:
B(int i):i(i){}
protected:
int i;
};
template<typename pat1> class C :
public B<pat1>http://gcc.gnu.org/bugs.html
{
public:
friend class A;
C(int i):
B<pat1>(i){}
};
// ------ End --------
Output from gcc:
gccbug.cc:16: warning: `class A' declares a new type at namespace scope
gccbug.cc:16: warning: names from dependent base classes are not visible to
unqualified name lookup - to refer to the inherited type, say `class C::A'
gccbug.cc:17: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
--
Summary: Segmentation fault when mixing inheritance, templates
and friends
Product: gcc
Version: 3.3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: chgros+bugzilla at stanford dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16391