summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-base3.C
blob: cffe9ea240c7e65251e97b996cd12ccf5fb830a1 (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
// PR c++/46526
// { dg-do run }
// { dg-options "-std=c++0x" }

struct Base
{
  virtual int getid () = 0;
};

struct A : public Base
{
  virtual int getid () { return 1; }
};

struct B : public Base
{
  virtual int getid () { throw "here"; }
};

int
main ()
{
  A a;
  B b;
  Base& ar = a;
  ar.getid ();
}