semantics.c (setup_vtbl_ptr): Always build a CTOR_INITIALIZER if we're in a template.

* semantics.c (setup_vtbl_ptr): Always build a CTOR_INITIALIZER
        if we're in a template.

From-SVN: r48985
This commit is contained in:
Jason Merrill 2002-01-18 08:25:27 -05:00
parent cc0723165e
commit e73c8e753c
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
// Test that vtables are set up properly for constructors and destructors
// of template classes.
// { dg-do run }
int r;
template <class T>
struct A {
virtual void f () { }
A() { f (); }
~A() { f (); }
};
struct B : public A<int> {
virtual void f () { ++r; }
};
int main ()
{
{ B b; }
return r;
}