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

Michal Urbanczyk <michal.w.urbanczyk at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |michal.w.urbanczyk at gmail 
dot co
                   |                            |m

--- Comment #4 from Michal Urbanczyk <michal.w.urbanczyk at gmail dot com> ---
I have encountered a similar issue without using Boost.Hana. My code worked
with GCC 7.3 and stopped compiling with GCC 8.1.

The reduced testcase:

struct Constant
{
    static constexpr int value = 0;
};
template<typename F>
void invokeWithConstant(F &&f)
{
    f(Constant{});
}
int foo()
{
    int count = 0;
    invokeWithConstant([&] (auto id1)
    {
        invokeWithConstant([&] (auto id2)
        {
            if constexpr(id1.value == 0  &&  id2.value == 0)
            {
                [&] { count = 1; } ();
            }
        });
    });
    return count;
}

====

Can be tested online at https://godbolt.org/z/N5rNYl

My case yields ICE from the very same line.

Reply via email to