1// PR c++/41927 2// { dg-do compile { target c++11 } } 3// { dg-options "-Wall" } 4 5// We were getting a spurious ||/&& warning about the enable_if with the 6// source position of d1. 7 8template<typename Tp> 9 struct is_int 10 { static const bool value = true; }; 11 12template<bool, typename Tp = void> 13 struct enable_if 14 { }; 15 16template<typename Tp> 17 struct enable_if<true, Tp> 18 { typedef Tp type; }; 19 20template<typename Rep> 21 struct duration 22 { 23 duration() { } 24 25 template<typename Rep2, typename = typename 26 enable_if<false || (true && is_int<Rep2>::value)>::type> 27 duration(const duration<Rep2>&) { } 28 }; 29 30int main() 31{ 32 duration<int> d0; 33 duration<int> d1 = d0; // { dg-warning "set but not used" } 34} 35 36