]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.old-deja/g++.pt/crash29.C
pt.c (check_nontype_parm): New function.
[gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / crash29.C
CommitLineData
2b0a63a3
MM
1// Build don't link:
2// Origin: Steven Parkes <parkes@sierravista.com>
3
a1ac6acc 4typedef __SIZE_TYPE__ size_t;
2b0a63a3
MM
5
6class UUId {};
7
8template <class T> class MetaClass;
9
10class TypeInfo;
11
12struct MetaClassGeneric
13{
14 MetaClassGeneric( TypeInfo& );
15};
16
17struct TypeInfo
18{
19 void (*constructor)( void* );
20 void initialize( void* );
21};
22
23template <class T>
24class TypeIDInit {
25public:
26 TypeIDInit();
27 static void initialize();
28 static TypeInfo info;
29 static int storage[];
30 static void metaclassConstructor( void* );
31};
32
33template <class T>
34TypeInfo TypeIDInit<T>::info =
35{
36 TypeIDInit<T>::metaclassConstructor
37};
38
39template <class T>
40inline
41TypeIDInit<T>::TypeIDInit()
42{
43 info.initialize(storage);
44}
45
46template <class T>
47class NameInfo : public MetaClassGeneric {
48public:
49 NameInfo()
50 : MetaClassGeneric( TypeIDInit<T>::info ) {}
51};
52
53class MetaClass<UUId>
54: public NameInfo<UUId>
55{
56};
57
58extern "C++"
59inline void *operator new(size_t, void *place) throw() { return place; }
60
61template <class T>
62void
63TypeIDInit<T>::metaclassConstructor( void* place )
64{
65 new ( place ) MetaClass<T>;
66}
67
68template class TypeIDInit<UUId> ;
69
This page took 0.613966 seconds and 5 git commands to generate.