Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/pr58046.C

raw
1 // { dg-do compile { target c++11 } }
2
3 template<bool, class T = void>
4 struct enable_if {};
5
6 template<class T>
7 struct enable_if<true, T>
8 {
9 using type = T;
10 };
11
12 template<class T>
13 struct is_true
14 {
15 static constexpr bool value = true;
16 };
17
18 extern void* enabler;
19
20 template <typename T, typename enable_if<is_true<T>::value>::type*& = enabler>
21 class A
22 {
23 public:
24 A()
25 {}
26 template <typename U>
27 A& operator=( A<U>&& )
28 {
29 return *this;
30 }
31 };
32
33 int main()
34 {
35 A<int> a_i;
36 A<double> a_d;
37
38 a_i = a_d; // { dg-error "cannot bind" }
39 }