[Bug c++/67164] ICE: tree check:=?UTF-8?Q?=20expected=20class=20=E2=80=98expression=E2=80=99?=,=?UTF-8?Q?=20have=20=E2=80=98exceptional=E2=80=99=20?=(argument_pack_select) in tree_operand_check, at tree.h:3356

ldionne.2 at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Feb 27 20:34:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67164

--- Comment #6 from Louis Dionne <ldionne.2 at gmail dot com> ---
The code I posted above does not seem to trigger the bug anymore on GCC trunk. 
However, the following code still produces an ICE on trunk:

> ~/code/gcc/prefix/bin/g++ --version
> g++ (GCC) 6.0.0 20160226 (experimental)

------------------------------------------------------------------------------
#include <type_traits>

namespace detail {
    template <bool ...b>
    struct fast_and
        : std::is_same<fast_and<b...>, fast_and<(b, true)...>>
    { };
}

template <typename ...Xn>
struct tuple {
    tuple() { }

    template <typename ...Yn, typename = typename std::enable_if<
        detail::fast_and<std::is_constructible<Xn, Yn&&>::value...>::value
    >::type>
    tuple(Yn&& ...yn) { }

    template <typename ...Yn, typename = typename std::enable_if<
        detail::fast_and<std::is_constructible<Xn, Yn const&>::value...>::value
    >::type>
    tuple(tuple<Yn...> const& other) { }
};

tuple<tuple<>> t{};
tuple<tuple<>> copy = t;
------------------------------------------------------------------------------


More information about the Gcc-bugs mailing list