aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/ref-qual13.C
blob: 84d3b0f2ddb69450864354ef5d119218adb94cf3 (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
29
// PR c++/57388
// { dg-require-effective-target c++11 }

template<class> struct A
{
  static constexpr bool value = false;
};

template<class Res, class... Args>
struct A<Res(Args...)>
{
  static constexpr bool value = true;
};

template<class Res, class... Args>
struct A<Res(Args...) const &>
{
  static constexpr bool value = true;
};

template<class Res, class... Args>
struct A<Res(Args...) const &&>
{
  static constexpr bool value = true;
};

static_assert(A<void()>::value, "Ouch");
static_assert(A<void() const &>::value, ""); // #1
static_assert(A<void() const &&>::value, ""); // #2