// { dg-do assemble }
|
// { dg-do assemble }
|
// Origin: Steven Parkes
|
// Origin: Steven Parkes
|
|
|
typedef __SIZE_TYPE__ size_t;
|
typedef __SIZE_TYPE__ size_t;
|
|
|
class UUId {};
|
class UUId {};
|
|
|
template class MetaClass;
|
template class MetaClass;
|
|
|
class TypeInfo;
|
class TypeInfo;
|
|
|
struct MetaClassGeneric
|
struct MetaClassGeneric
|
{
|
{
|
MetaClassGeneric( TypeInfo& );
|
MetaClassGeneric( TypeInfo& );
|
};
|
};
|
|
|
struct TypeInfo
|
struct TypeInfo
|
{
|
{
|
void (*constructor)( void* );
|
void (*constructor)( void* );
|
void initialize( void* );
|
void initialize( void* );
|
};
|
};
|
|
|
template
|
template
|
class TypeIDInit {
|
class TypeIDInit {
|
public:
|
public:
|
TypeIDInit();
|
TypeIDInit();
|
static void initialize();
|
static void initialize();
|
static TypeInfo info;
|
static TypeInfo info;
|
static int storage[];
|
static int storage[];
|
static void metaclassConstructor( void* );
|
static void metaclassConstructor( void* );
|
};
|
};
|
|
|
template
|
template
|
TypeInfo TypeIDInit::info =
|
TypeInfo TypeIDInit::info =
|
{
|
{
|
TypeIDInit::metaclassConstructor
|
TypeIDInit::metaclassConstructor
|
};
|
};
|
|
|
template
|
template
|
inline
|
inline
|
TypeIDInit::TypeIDInit()
|
TypeIDInit::TypeIDInit()
|
{
|
{
|
info.initialize(storage);
|
info.initialize(storage);
|
}
|
}
|
|
|
template
|
template
|
class NameInfo : public MetaClassGeneric {
|
class NameInfo : public MetaClassGeneric {
|
public:
|
public:
|
NameInfo()
|
NameInfo()
|
: MetaClassGeneric( TypeIDInit::info ) {}
|
: MetaClassGeneric( TypeIDInit::info ) {}
|
};
|
};
|
|
|
template <>
|
template <>
|
class MetaClass
|
class MetaClass
|
: public NameInfo
|
: public NameInfo
|
{
|
{
|
};
|
};
|
|
|
extern "C++"
|
extern "C++"
|
inline void *operator new(size_t, void *place) throw() { return place; }
|
inline void *operator new(size_t, void *place) throw() { return place; }
|
|
|
template
|
template
|
void
|
void
|
TypeIDInit::metaclassConstructor( void* place )
|
TypeIDInit::metaclassConstructor( void* place )
|
{
|
{
|
new ( place ) MetaClass;
|
new ( place ) MetaClass;
|
}
|
}
|
|
|
template class TypeIDInit ;
|
template class TypeIDInit ;
|
|
|
|
|