public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605
@ 2022-11-08 17:26 gscfq@t-online.de
  2022-11-21 12:06 ` [Bug c++/107575] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: gscfq@t-online.de @ 2022-11-08 17:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107575
           Summary: ICE: tree check: expected tree that contains 'decl
                    common' structure, have 'error_mark' in
                    duplicate_decls, at cp/decl.cc:2605
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started with r11 :


$ cat z1.cc
void f (void) {
  virtual int f(void) const;
  virtual int f(void);
}


$ g++-13-20221106 -c z1.cc
z1.cc: In function 'void f()':
z1.cc:2:3: error: 'virtual' outside class declaration
    2 |   virtual int f(void) const;
      |   ^~~~~~~
z1.cc:2:23: error: non-member function 'int f()' cannot have cv-qualifier
    2 |   virtual int f(void) const;
      |                       ^~~~~
z1.cc: At global scope:
z1.cc:2:15: error: ambiguating new declaration of 'int f()'
    2 |   virtual int f(void) const;
      |               ^
z1.cc:1:6: note: old declaration 'void f()'
    1 | void f (void) {
      |      ^
z1.cc: In function 'void f()':
z1.cc:3:3: error: 'virtual' outside class declaration
    3 |   virtual int f(void);
      |   ^~~~~~~
z1.cc:3:21: internal compiler error: tree check: expected tree that contains
'decl common' structure, have 'error_mark' in duplicate_decls, at
cp/decl.cc:2605
    3 |   virtual int f(void);
      |                     ^
0x70381d tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ../../gcc/tree.cc:9020
0x8e2b53 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        ../../gcc/tree.h:3646
0x8e2b53 duplicate_decls(tree_node*, tree_node*, bool, bool)
        ../../gcc/cp/decl.cc:2605
0x9d1ba3 pushdecl(tree_node*, bool)
        ../../gcc/cp/name-lookup.cc:3686
0x8f026c start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc/cp/decl.cc:5776
0xa32749 cp_parser_init_declarator
        ../../gcc/cp/parser.cc:22757
0xa05e62 cp_parser_simple_declaration
        ../../gcc/cp/parser.cc:15288
0xa07a19 cp_parser_declaration_statement
        ../../gcc/cp/parser.cc:14369
0xa080db cp_parser_statement
        ../../gcc/cp/parser.cc:12440
0xa09204 cp_parser_statement_seq_opt
        ../../gcc/cp/parser.cc:12857
0xa092e7 cp_parser_compound_statement
        ../../gcc/cp/parser.cc:12809
0xa31760 cp_parser_function_body
        ../../gcc/cp/parser.cc:25183
0xa31760 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.cc:25234
0xa31dda cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.cc:31392
0xa3331c cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/cp/parser.cc:31309
0xa3331c cp_parser_init_declarator
        ../../gcc/cp/parser.cc:22637
0xa05e62 cp_parser_simple_declaration
        ../../gcc/cp/parser.cc:15288
0xa3aceb cp_parser_declaration
        ../../gcc/cp/parser.cc:14974
0xa3b808 cp_parser_translation_unit
        ../../gcc/cp/parser.cc:5080
0xa3b808 c_parse_file()
        ../../gcc/cp/parser.cc:48817

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/107575] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b
  2022-11-08 17:26 [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 gscfq@t-online.de
@ 2022-11-21 12:06 ` marxin at gcc dot gnu.org
  2022-11-21 16:26 ` [Bug c++/107575] [12/13 Regression] " pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-11-21 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-11-21
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
            Summary|ICE: tree check: expected   |ICE: tree check: expected
                   |tree that contains 'decl    |tree that contains 'decl
                   |common' structure, have     |common' structure, have
                   |'error_mark' in             |'error_mark' in
                   |duplicate_decls, at         |duplicate_decls, at
                   |cp/decl.cc:2605             |cp/decl.cc:2605 since
                   |                            |r12-8115-g791a968630b3846b
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-8115-g791a968630b3846b.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/107575] [12/13 Regression] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b
  2022-11-08 17:26 [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 gscfq@t-online.de
  2022-11-21 12:06 ` [Bug c++/107575] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b marxin at gcc dot gnu.org
@ 2022-11-21 16:26 ` pinskia at gcc dot gnu.org
  2022-12-20 15:35 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-21 16:26 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |trivial
            Summary|ICE: tree check: expected   |[12/13 Regression] ICE:
                   |tree that contains 'decl    |tree check: expected tree
                   |common' structure, have     |that contains 'decl common'
                   |'error_mark' in             |structure, have
                   |duplicate_decls, at         |'error_mark' in
                   |cp/decl.cc:2605 since       |duplicate_decls, at
                   |r12-8115-g791a968630b3846b  |cp/decl.cc:2605 since
                   |                            |r12-8115-g791a968630b3846b
   Target Milestone|---                         |12.3

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/107575] [12/13 Regression] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b
  2022-11-08 17:26 [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 gscfq@t-online.de
  2022-11-21 12:06 ` [Bug c++/107575] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b marxin at gcc dot gnu.org
  2022-11-21 16:26 ` [Bug c++/107575] [12/13 Regression] " pinskia at gcc dot gnu.org
@ 2022-12-20 15:35 ` rguenth at gcc dot gnu.org
  2023-05-08 12:25 ` [Bug c++/107575] [12/13/14 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-20 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/107575] [12/13/14 Regression] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b
  2022-11-08 17:26 [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2022-12-20 15:35 ` rguenth at gcc dot gnu.org
@ 2023-05-08 12:25 ` rguenth at gcc dot gnu.org
  2024-06-04 19:43 ` [Bug c++/107575] [12/13/14/15 " simartin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-08 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|12.3                        |12.4

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 12.3 is being released, retargeting bugs to GCC 12.4.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/107575] [12/13/14/15 Regression] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b
  2022-11-08 17:26 [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2023-05-08 12:25 ` [Bug c++/107575] [12/13/14 " rguenth at gcc dot gnu.org
@ 2024-06-04 19:43 ` simartin at gcc dot gnu.org
  2024-06-07 18:41 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-06-04 19:43 UTC (permalink / raw)
  To: gcc-bugs

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

Simon Martin <simartin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |simartin at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #3 from Simon Martin <simartin at gcc dot gnu.org> ---
Working on it

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/107575] [12/13/14/15 Regression] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b
  2022-11-08 17:26 [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2024-06-04 19:43 ` [Bug c++/107575] [12/13/14/15 " simartin at gcc dot gnu.org
@ 2024-06-07 18:41 ` cvs-commit at gcc dot gnu.org
  2024-06-07 18:43 ` simartin at gcc dot gnu.org
  2024-06-10 15:01 ` simartin at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-07 18:41 UTC (permalink / raw)
  To: gcc-bugs

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 <simartin@gcc.gnu.org>:

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

commit r15-1105-g0ce138694a6b40708a80691fa4003f6af1defa49
Author: Simon Martin <simon@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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/107575] [12/13/14/15 Regression] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b
  2022-11-08 17:26 [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2024-06-07 18:41 ` cvs-commit at gcc dot gnu.org
@ 2024-06-07 18:43 ` simartin at gcc dot gnu.org
  2024-06-10 15:01 ` simartin at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-06-07 18:43 UTC (permalink / raw)
  To: gcc-bugs

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

Simon Martin <simartin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|12.4                        |14.2
         Resolution|---                         |FIXED

--- Comment #5 from Simon Martin <simartin at gcc dot gnu.org> ---
Fixed in trunk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/107575] [12/13/14/15 Regression] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b
  2022-11-08 17:26 [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 gscfq@t-online.de
                   ` (6 preceding siblings ...)
  2024-06-07 18:43 ` simartin at gcc dot gnu.org
@ 2024-06-10 15:01 ` simartin at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-06-10 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

Simon Martin <simartin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|14.2                        |15.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-06-10 15:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 17:26 [Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 gscfq@t-online.de
2022-11-21 12:06 ` [Bug c++/107575] ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605 since r12-8115-g791a968630b3846b marxin at gcc dot gnu.org
2022-11-21 16:26 ` [Bug c++/107575] [12/13 Regression] " pinskia at gcc dot gnu.org
2022-12-20 15:35 ` rguenth at gcc dot gnu.org
2023-05-08 12:25 ` [Bug c++/107575] [12/13/14 " rguenth at gcc dot gnu.org
2024-06-04 19:43 ` [Bug c++/107575] [12/13/14/15 " simartin at gcc dot gnu.org
2024-06-07 18:41 ` cvs-commit at gcc dot gnu.org
2024-06-07 18:43 ` simartin at gcc dot gnu.org
2024-06-10 15:01 ` simartin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).