FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / crash29.C
blob5334cd30c5c768a5c5d9ef7a2cac6ebc1631408b
1 // Build don't link:
2 // Origin: Steven Parkes <parkes@sierravista.com>
4 typedef __SIZE_TYPE__ size_t;
6 class UUId {};
8 template <class T> class MetaClass;
10 class TypeInfo;
12 struct MetaClassGeneric 
14                                 MetaClassGeneric( TypeInfo& );
17 struct TypeInfo 
19                         void    (*constructor)( void* );
20                         void    initialize( void* );
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* );
33 template <class T>
34 TypeInfo TypeIDInit<T>::info = 
36   TypeIDInit<T>::metaclassConstructor
39 template <class T>
40 inline
41 TypeIDInit<T>::TypeIDInit()
43   info.initialize(storage);
46 template <class T>
47 class NameInfo : public MetaClassGeneric {
48 public:
49                                 NameInfo() 
50                                 : MetaClassGeneric( TypeIDInit<T>::info ) {}
53 template <>
54 class MetaClass<UUId>
55 : public NameInfo<UUId>
59 extern "C++"
60 inline void *operator new(size_t, void *place) throw() { return place; }
62 template <class T>
63 void
64 TypeIDInit<T>::metaclassConstructor( void* place )
66   new ( place ) MetaClass<T>;
69 template class   TypeIDInit<UUId>   ;