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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Martin <simar...@gcc.gnu.org>:

https://gcc.gnu.org/g:0ce138694a6b40708a80691fa4003f6af1defa49

commit r15-1105-g0ce138694a6b40708a80691fa4003f6af1defa49
Author: Simon Martin <si...@nasilyan.com>
Date:   Tue Jun 4 21:20:23 2024 +0200

    c++: Handle erroneous DECL_LOCAL_DECL_ALIAS in duplicate_decls [PR107575]

    We currently ICE upon the following because we don't properly handle local
    functions with an error_mark_node as DECL_LOCAL_DECL_ALIAS in
duplicate_decls.

    === cut here ===
    void f (void) {
      virtual int f (void) const;
      virtual int f (void);
    }
    === cut here ===

    This patch fixes this by checking for error_mark_node.

    Successfully tested on x86_64-pc-linux-gnu.

            PR c++/107575

    gcc/cp/ChangeLog:

            * decl.cc (duplicate_decls): Check for error_mark_node
            DECL_LOCAL_DECL_ALIAS.

    gcc/testsuite/ChangeLog:

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

Reply via email to