URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [union2.C] - Rev 853
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do assemble }
// Origin: David Mazieres <dm@amsterdam.lcs.mit.edu>
template<class T> struct vector_base {
typedef T elm_t;
protected:
union {
double alignment_hack;
char defbuf_space[2 * sizeof (elm_t)];
};
elm_t *def_basep () { return reinterpret_cast<elm_t *> (defbuf_space); }
};
template<class T> struct vector : public vector_base<T> {
vector () { this->def_basep (); }
};
vector<int> iv;
Go to most recent revision | Compare with Previous | Blame | View Log