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

            Bug ID: 103212
           Summary: requires expression with lambda fails
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egor.pugin at gmail dot com
  Target Milestone: ---

---
constexpr bool test = requires { [](auto o){}(0); };
static_assert(test);
---

gives

<source>:1:37: error: expected primary-expression before 'auto'
    1 | constexpr bool test = requires { [](auto o){}(0); };
      |                                     ^~~~

Also see for compiler comparison:
https://godbolt.org/z/zYGa733d4

msvc fails that condition, clang compiles ok.

Reply via email to