summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C
blob: ce23cb9dd10957daf38668fbf05a7231f7955e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// PR c++/46626
// { dg-do run }
// { dg-options "-std=c++0x" }

struct A
{
  virtual void f () = 0;
  virtual ~A () { }
};

struct B : A
{
  virtual void f () { }
};

static void
foo (A *a)
{
  a->f ();
}

int
main ()
{
  B b;
  foo (&b);
  return 0;
}