2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / defaulted4.C
blobca07d76d7b5f3c38c3c65e6cef301378ddbb0765
1 // PR c++/37208: SFINAE and deleted functions.
3 // { dg-do compile { target c++11 } }
4 template<int> struct A { };
6 template<typename T>
7 int& int_if_addable(A<sizeof((*(T*)0) + (*(T*)0))>*);
9 template<typename T>
10 float& int_if_addable(...);
12 struct X { };
14 struct Y { };
15 Y operator+(Y, Y);
17 struct Z { };
18 Z operator+(Z, Z) = delete;
20 void f()
22  float& x = int_if_addable<X>(0);
23  int& y = int_if_addable<Y>(0);
24  float& z = int_if_addable<Z>(0);