[Bug c++/112769] ICE on valid code related to requires-expression

janpmoeller at gmx dot de gcc-bugzilla@gcc.gnu.org
Thu Nov 30 18:48:46 GMT 2023


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

--- Comment #1 from janpmoeller at gmx dot de ---
The following equivalent program does not trigger the ICE:

//////////////////////////////////////////////////////////////
template<typename T, typename U>
concept C = requires (U u) { T{u}; };

template<int I, typename T>
struct type
{
    constexpr explicit type(T value)
    {
    }

    template<typename U>
    constexpr explicit type(type<I, U> value)
        requires C<T, type<I, U>>
    {
    }
};

template <typename T>
using alias = type<0, T>;

constexpr alias foo{123};
//////////////////////////////////////////////////////////////


More information about the Gcc-bugs mailing list