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

--- Comment #1 from Steven Sun <StevenSun2021 at hotmail dot com> ---
The compiler args are only "g++ -fconcepts -std=c++17"

It should choose the full specialization func(int &&), while the compiler
aborts during the instatiation of the partial specialization (using concepts).

If either the partial or the full specialzation is removed, it compiles.


New online compiler link: https://godbolt.org/z/fK5G61
-------------------------------------------------------------------------
template <typename T>
void func(T &&arg)
{
}

template <typename T>
requires requires(T t) { ++t; }
void func(T &&arg)
{
}

template <>
void func(int &&arg)
{
}

int main()
{
    func(1); // I am expecting func(int&&)
}
-------------------------------------------------------------------------

Error:
In instantiation of ‘void func(T&&) [with T = int]’:
internal compiler error: Segmentation fault
   11 | }
      | ^
Please submit a full bug report,

Reply via email to