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

Enrico Seiler <enrico.seiler at hotmail dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |enrico.seiler at hotmail dot de

--- Comment #2 from Enrico Seiler <enrico.seiler at hotmail dot de> ---
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.
  • [Bug c++/100474] ICE: in diag... enrico.seiler at hotmail dot de via Gcc-bugs

Reply via email to