public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102925] New: [11.2]ICE with concept of std::convertible_to with lambda in unevaluated-context
@ 2021-10-25 10:11 nickhuang99 at hotmail dot com
  2021-10-25 12:40 ` [Bug c++/102925] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nickhuang99 at hotmail dot com @ 2021-10-25 10:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102925
           Summary: [11.2]ICE with concept of std::convertible_to with
                    lambda in unevaluated-context
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickhuang99 at hotmail dot com
  Target Milestone: ---

The following code causes ICE in 11.2 when clang and MSVC++ all work fine.
(https://www.godbolt.org/z/eGq118ohT)
This ICE is fixed in trunk with a different issue of no matching template
declaration for template specialization. 

#include <concepts>

template<class T>
concept IsLambda=std::convertible_to<T,decltype(+[]{})>;

template<IsLambda T> 
void foo(T t){ t();}

template<>
void foo<decltype(+[]{})>(decltype(+[]{}) t){
    t();
}



<source>:10:6: error: template-id 'foo<void (*)()>' for 'void foo(void (*)())'
does not match any template declaration
   10 | void foo<decltype(+[]{})>(decltype(+[]{}) t){
      |      ^~~~~~~~~~~~~~~~~~~~
<source>:7:6: note: candidate is: 'template<class T>  requires  IsLambda<T>
void foo(T)'
    7 | void foo(T t){ t();}
      |      ^~~
Compiler returned: 1

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

end of thread, other threads:[~2024-04-13  7:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 10:11 [Bug c++/102925] New: [11.2]ICE with concept of std::convertible_to with lambda in unevaluated-context nickhuang99 at hotmail dot com
2021-10-25 12:40 ` [Bug c++/102925] " pinskia at gcc dot gnu.org
2021-10-25 15:12 ` nickhuang99 at hotmail dot com
2024-04-13  7:58 ` pinskia 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).