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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>:

https://gcc.gnu.org/g:a6a15bc5b77c8703a95130f410a944f5408a5cc4

commit r15-6251-ga6a15bc5b77c8703a95130f410a944f5408a5cc4
Author: Nathaniel Shead <nathanielosh...@gmail.com>
Date:   Thu Nov 7 21:37:28 2024 +1100

    c++: Disallow decomposition of lambda bases [PR90321]

    Decomposition of lambda closure types is not allowed by
    [dcl.struct.bind] p6, since members of a closure have no name.

    r244909 made this an error, but missed the case where a lambda is used
    as a base.  This patch moves the check to find_decomp_class_base to
    handle this case.

    As a drive-by improvement, we also slightly improve the diagnostics to
    indicate why a base class was being inspected.  Ideally the diagnostic
    would point directly at the relevant base, but there doesn't seem to be
    an easy way to get this location just from the binfo so I don't worry
    about that here.

            PR c++/90321

    gcc/cp/ChangeLog:

            * decl.cc (find_decomp_class_base): Check for decomposing a
            lambda closure type.  Report base class chains if needed.
            (cp_finish_decomp): Remove no-longer-needed check.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp1z/decomp62.C: New test.

    Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>
    Reviewed-by: Marek Polacek <pola...@redhat.com>
  • [Bug c++/90321] [C++17+] GCC al... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to