Commit e73c8e75 by Jason Merrill

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
parent cc072316
// 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment