This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: c++/3154


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]