vtable-instantiation.cc [plain text]
namespace PR8640 {
template<class T1> struct C1 {
virtual void c1() {
T1 t1 = 3; }
};
template<class T2> struct C2 {
void c2() {
new C1<T2>(); }
};
void f() {
C2<int*> c2;
c2.c2(); }
}
namespace PR9325 {
template<typename T>
class Target
{
public:
virtual T Value() const
{
return 1; }
};
template<typename T>
struct Provider
{
static Target<T> Instance;
};
template<typename T>
Target<T> Provider<T>::Instance;
void f()
{
Target<int*>* traits = &Provider<int*>::Instance;
}
}
namespace PR10020 {
struct MG {
virtual void Accept(int) = 0;
};
template <typename Type>
struct GMG : MG {
void Accept(int i) {
static_cast<Type *>(0)->Accept(i); }
static GMG* Method() { return &singleton; } static GMG singleton;
};
template <typename Type>
GMG<Type> GMG<Type>::singleton;
void test(void) {
GMG<int>::Method(); }
}