public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99686] New: ICE when concepts on C++17 when providing both T&& and const T& specialization
@ 2021-03-20 19:21 StevenSun2021 at hotmail dot com
  2021-03-20 19:43 ` [Bug c++/99686] " StevenSun2021 at hotmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: StevenSun2021 at hotmail dot com @ 2021-03-20 19:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99686
           Summary: ICE when concepts on C++17 when providing both T&& and
                    const T& specialization
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: StevenSun2021 at hotmail dot com
  Target Milestone: ---

This problem occurs only when using std=c++17 and -fconcepts. It compiles when
using std=c++20.


I also have an online compiler link for this. https://godbolt.org/z/W9r6Wx

-------------------------------------------------------------------------
template <typename T>
void func(T &&arg)
{
}

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

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

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

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-07 15:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-20 19:21 [Bug c++/99686] New: ICE when concepts on C++17 when providing both T&& and const T& specialization StevenSun2021 at hotmail dot com
2021-03-20 19:43 ` [Bug c++/99686] " StevenSun2021 at hotmail dot com
2021-03-21  6:51 ` [Bug c++/99686] ICE when using both concepts and full specialization webrown.cpp at gmail dot com
2021-03-25 11:35 ` StevenSun2021 at hotmail dot com
2021-03-25 12:32 ` webrown.cpp at gmail dot com
2021-05-05  0:09 ` StevenSun2021 at hotmail dot com
2021-05-05  0:33 ` StevenSun2021 at hotmail dot com
2021-05-07 13:15 ` StevenSun2021 at hotmail dot com
2021-05-07 14:35 ` StevenSun2021 at hotmail dot com
2022-12-07 15:55 ` [Bug c++/99686] ICE when using concepts on function template before c++20 (Reason already found) ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).