Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/ref-qual13.C

raw
1 // PR c++/57388
2 // { dg-require-effective-target c++11 }
3
4 template<class> struct A
5 {
6 static constexpr bool value = false;
7 };
8
9 template<class Res, class... Args>
10 struct A<Res(Args...)>
11 {
12 static constexpr bool value = true;
13 };
14
15 template<class Res, class... Args>
16 struct A<Res(Args...) const &>
17 {
18 static constexpr bool value = true;
19 };
20
21 template<class Res, class... Args>
22 struct A<Res(Args...) const &&>
23 {
24 static constexpr bool value = true;
25 };
26
27 static_assert(A<void()>::value, "Ouch");
28 static_assert(A<void() const &>::value, ""); // #1
29 static_assert(A<void() const &&>::value, ""); // #2