aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/expr/static_cast3.C
blob: 744648c3f45ef2486a46cf0e7d801cea4c57d404 (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
template <class T> struct static_abort {};

template <class E>
struct any
{
  const E& self() const { return static_cast<const E&>(*this); }
};

struct range : public any<range>
{
  range() {}

  template <class U>
  range(const U&)
  {
    typedef typename static_abort<U>::ret t;
  }
};

int main()
{
  const any<range>& r = *new range();
  r.self();
}