PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / template / sfinae16.C
blob3df581a32936bade6b4e3d34333ef31b65d83c22
1 // PR c++/41927
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wall" }
5 // We were getting a spurious ||/&& warning about the enable_if with the
6 // source position of d1.
8 template<typename Tp>
9   struct is_int
10   { static const bool value = true; };
12 template<bool, typename Tp = void>
13   struct enable_if
14   { };
16 template<typename Tp>
17   struct enable_if<true, Tp>
18   { typedef Tp type; };
20 template<typename Rep>
21   struct duration
22   {
23     duration() { }
25     template<typename Rep2, typename = typename
26              enable_if<false || (true && is_int<Rep2>::value)>::type>
27     duration(const duration<Rep2>&) { }
28   };
30 int main()
32   duration<int> d0;
33   duration<int> d1 = d0;        // { dg-warning "set but not used" }