Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.pt/crash29.C

raw
1 // { dg-do assemble }
2 // Origin: Steven Parkes <[email protected]>
3
4 typedef __SIZE_TYPE__ size_t;
5
6 class UUId {};
7
8 template <class T> class MetaClass;
9
10 class TypeInfo;
11
12 struct MetaClassGeneric
13 {
14 MetaClassGeneric( TypeInfo& );
15 };
16
17 struct TypeInfo
18 {
19 void (*constructor)( void* );
20 void initialize( void* );
21 };
22
23 template <class T>
24 class TypeIDInit {
25 public:
26 TypeIDInit();
27 static void initialize();
28 static TypeInfo info;
29 static int storage[];
30 static void metaclassConstructor( void* );
31 };
32
33 template <class T>
34 TypeInfo TypeIDInit<T>::info =
35 {
36 TypeIDInit<T>::metaclassConstructor
37 };
38
39 template <class T>
40 inline
41 TypeIDInit<T>::TypeIDInit()
42 {
43 info.initialize(storage);
44 }
45
46 template <class T>
47 class NameInfo : public MetaClassGeneric {
48 public:
49 NameInfo()
50 : MetaClassGeneric( TypeIDInit<T>::info ) {}
51 };
52
53 template <>
54 class MetaClass<UUId>
55 : public NameInfo<UUId>
56 {
57 };
58
59 extern "C++"
60 inline void *operator new(size_t, void *place) throw() { return place; }
61
62 template <class T>
63 void
64 TypeIDInit<T>::metaclassConstructor( void* place )
65 {
66 new ( place ) MetaClass<T>;
67 }
68
69 template class TypeIDInit<UUId> ;
70