2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / pr58046.C
blobb2c0541e951065a506d662f0bc1b83e09c7ed458
1 // { dg-do compile { target c++11 } }
3 template<bool, class T = void>
4 struct enable_if {};
6 template<class T>
7 struct enable_if<true, T>
9   using type = T;
12 template<class T>
13 struct is_true
15   static constexpr bool value = true;
18 extern void* enabler;
20 template <typename T, typename enable_if<is_true<T>::value>::type*& = enabler>
21 class A
23 public:
24     A()
25     {}
26     template <typename U>
27     A& operator=( A<U>&& )
28     {
29         return *this;
30     }
33 int main()
35     A<int> a_i;
36     A<double> a_d;
38     a_i = a_d;  // { dg-error "cannot bind" }