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

            Bug ID: 113925
           Summary: static assert on requires clause with non-type bool
                    template instantiated with immediately invoked
                    consteval lambda is incorrectly rejected
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gieseanw+gcc at gmail dot com
  Target Milestone: ---

template<bool B>
struct b{};
static_assert(requires { b<([]()consteval{ return true; }())>{}; });

In gcc 13.2 and 14.0.1 this produces:

error: template argument 1 is invalid
    3 | static_assert(requires { b<([]()consteval{ return true; }())>{}; });
      |                                                     ^

Godbolt: https://godbolt.org/z/7dacc7rKr
StackOverflow: https://stackoverflow.com/a/77996234/27678
  • [Bug c++/113925] New: static as... gieseanw+gcc at gmail dot com via Gcc-bugs

Reply via email to