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

--- Comment #3 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to Enrico Seiler from comment #2)
> Here is a version not dependent on range-v3:
> 
> https://godbolt.org/z/PvdhxGo5c
> 
> ```
> template <typename T, typename... Args>
> concept foo = __is_constructible(T, Args...);
> 
> class S
> {
> public:
>     S() = delete;
>     S(S const &) = default;
>     S(S &&) = default;
>     S & operator=(S const &) = default;
>     S & operator=(S &&) = default;
>     ~S() = default;
> };
> 
> int main()
> {
>     // static_assert(!__is_constructible(S)); // OK
>     // static_assert(!foo<S>); // OK
>     // static_assert(__is_constructible(S)); // FAILS
>     static_assert(foo<S>); // ICE
> }
> ```
> 
> The parameter pack is not necessary for the ICE to occur, however, it is
> what META_IS_CONSTRUCTIBLE is expanded to in range-v3.
> 
> Using `concept foo = static_cast<bool>(__is_constructible(T, Args...));`
> will remove the ICE, even though `__is_constructible` should already return
> a bool.

I can't imagine you can reduce it, thank you very much!

Reply via email to