// { dg-do compile { target c++17 } } // Verify constexpr evaluation of a large left fold logical expression // isn't quadratic in the size of the expanded expression. template struct S { static constexpr bool value = true; }; template struct integer_sequence { }; template using make_integer_sequence #if __has_builtin(__make_integer_seq) = __make_integer_seq; #else = integer_sequence; #endif template constexpr bool f_impl(integer_sequence) { return (... && S::value); } static_assert(f_impl(make_integer_sequence())); template constexpr bool g_impl(integer_sequence) { return (... || !S::value); } static_assert(!g_impl(make_integer_sequence()));