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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

https://gcc.gnu.org/g:44c5485dac70d7f0d62e880b1162d49805404ed8

commit r17-322-g44c5485dac70d7f0d62e880b1162d49805404ed8
Author: Andrew Pinski <[email protected]>
Date:   Sun Apr 19 22:05:10 2026 -0700

    c++: Fix handling of && after a class definition [PR65271]

    After r166977, we are wrongly rejecting:
    struct {} && m = {};
    because our code to diagnose a missing ; after a class definition doesn't
    realize that && can follow a class definition.

    This is simlar in nature to what was done for `::` in
r12-8304-g851031b2fcd5210b9676.

    Bootstrapped and tested on x86_64-linux-gnu.

    Changes since v1:
    * v2: Remove the check on c++11 and add a few more testcases.
    * v3: Move CPP_AND_AND right below CPP_AND_AND and add enum case to the
testcase.

            PR c++/65271

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_class_specifier): Accept &&.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/rv-decl1.C: New test.

    Signed-off-by: Andrew Pinski <[email protected]>

Reply via email to