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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>:

https://gcc.gnu.org/g:7b1de3eb9ed3f8dde54732d88520292c5ad1157d

commit r12-2766-g7b1de3eb9ed3f8dde54732d88520292c5ad1157d
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Thu Aug 5 13:34:00 2021 +0100

    libstdc++: Move attributes that follow requires-clauses [PR101782]

    As explained in the PR, the grammar in the Concepts TS means that a [
    token following a requires-clause is parsed as part of the
    logical-or-expression rather than the start of an attribute. That makes
    the following ill-formed when using -fconcepts-ts:

      template<typename T> requires foo<T> [[nodiscard]] int f(T);

    This change moves all attributes that follow a requires-clause to the
    end of the function declarator.

    Signed-off-by: Jonathan Wakely <jwak...@redhat.com>

    libstdc++-v3/ChangeLog:

            PR libstdc++/101782
            * include/bits/ranges_base.h (ranges::begin, ranges::end)
            (ranges::rbegin, ranges::rend, ranges::size, ranges::ssize)
            (ranges::empty, ranges::data): Move attribute to the end of
            the declarator.
            * include/bits/stl_iterator.h (__gnu_cxx::__normal_iterator)
            (common_iterator): Likewise for non-member operator functions.
            * include/std/ranges (views::all, views::filter)
            (views::transform, views::take, views::take_while, views::drop)
            (views::drop_while, views::join, views::lazy_split)
            (views::split, views::counted, views::common, views::reverse)
            (views::elements): Likewise.
            * testsuite/std/ranges/access/101782.cc: New test.

Reply via email to