This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3154
- To: <gcc-gnats at gcc dot gnu dot org>, <gcc-bugs at gcc dot gnu dot org>, <nobody at gcc dot gnu dot org>, "Мерзляков, Владимир Александрович" <wanderer at rsu dot ru>
- Subject: Re: c++/3154
- From: "Vladimir A Merzliakov" <wanderer at rsu dot ru>
- Date: Fri, 15 Jun 2001 20:56:57 +0400
My source (.ii file) is not legal C++, but G++ crash in any choice.
More simple testcase for bug is:
//** Start file
template<class T>
struct A {
A() {};
};
class C {
C() {};
};
struct B : A<C> { // 1
typedef A<C*> Imp; // 2 * A<C*> isn't base type for B
B() : Imp() {}; // 3 CRASH
};
int main() {
B b;
return 0;
};
//** end file
It crash with error repert:
g++ -MD -fexceptions -W -Wall -Werror -O -Wuninitialized -Wredundant-decls
-pedantic -nostdinc++ -nodefaultlibs -pipe -an
si -march=athlon -O5 -I/home/wanderer/pkg/gcc/include/g++ -I/home/wanderer/
pkg/gcc/include/g++/i386-unknown-freebsd4.3 -I/hom
e/wanderer/pkg/gcc/lib/gcc-lib/i386-unknown-freebsd4.3/3.0/include -DNDEBUG
-o 3154.o -c 3154.cc
3154.cc: In constructor `B::B()':
3154.cc:12: Tree check: expected class 't', have 'd' (type_decl) in
is_aggr_type, at cp/init.c:1435
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
Bug isn't present if subst typedef in B::B() constructor:
B() : A<C*>() {}; // 3 proper error message
or fix program:
typedef A<C> Imp; // 2 compile without error
Vladimir
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%26pr=3154%26database=gcc