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

            Bug ID: 120370
           Summary: GCC fails to parse a trailing requires-clause that
                    ends with an identifier when followed by a
                    ctor-initializer
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

struct C {
    int j;
    static constexpr bool i = true;
    template<class T>
    C(T&&) requires i : j() {}
};


<source>:5:23: error: found ':' in nested-name-specifier, expected '::'
    5 |     C(T&&) requires i : j() {}
      |                       ^
      |                       ::
<source>:5:21: error: 'i' is not a class, namespace, or enumeration
    5 |     C(T&&) requires i : j() {}
      |                     ^
<source>:5:27: error: 'C' declared as function returning a function
    5 |     C(T&&) requires i : j() {}
      |                           ^


Clang accepts.

Reply via email to