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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>:

https://gcc.gnu.org/g:1fbb7d75abbb050f790d8b43422602ee4b152608

commit r14-4694-g1fbb7d75abbb050f790d8b43422602ee4b152608
Author: Marek Polacek <pola...@redhat.com>
Date:   Tue Oct 17 16:11:11 2023 -0400

    c++: accepts-invalid with =delete("") [PR111840]

    r6-2367 added a DECL_INITIAL check to cp_parser_simple_declaration
    so that we don't emit multiple errors in g++.dg/parse/error57.C.
    But that means we don't diagnose

      int f1() = delete("george_crumb");

    anymore, because fn decls often have error_mark_node in their
    DECL_INITIAL.  (The code may be allowed one day via
https://wg21.link/P2573R0.)

    I was hoping I could use cp_parser_error_occurred but that would
    regress error57.C.

            PR c++/111840

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_simple_declaration): Do cp_parser_error
            for FUNCTION_DECLs.

    gcc/testsuite/ChangeLog:

            * g++.dg/parse/error65.C: New test.

Reply via email to