blob: 61fc68b9117cddbcc0b49888dd0cfe367a2ef579 [file] [log] [blame]
/* Verify that final methods are devirtualized */
/* { dg-do compile { target c++11 } } */
/* { dg-options "-fdump-tree-original" } */
struct A final
{
virtual void foo ()
{
}
};
struct B
{
virtual void foo () final
{
}
};
void fun(A* a, B* b)
{
a->foo();
b->foo();
}
/* { dg-final { scan-tree-dump-times "A::foo" 2 "original" } } */
/* { dg-final { scan-tree-dump-times "B::foo" 2 "original" } } */