public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/101887] New: [9/10/11/12 Regression] ICE with invalid declaration of 'operator delete'
Date: Thu, 12 Aug 2021 17:33:50 +0000	[thread overview]
Message-ID: <bug-101887-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101887
           Summary: [9/10/11/12 Regression] ICE with invalid declaration
                    of 'operator delete'
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 4.9.0:

================================================
struct A
{
  A();
  auto operator delete(void*, __SIZE_TYPE__);
};

void foo()
{
  new A;
}
================================================

bug.cc:4:3: error: non-static data member declared with placeholder 'auto'
    4 |   auto operator delete(void*, __SIZE_TYPE__);
      |   ^~~~
bug.cc: In function 'void foo()':
bug.cc:9:7: internal compiler error: tree check: expected function_type or
method_type, have error_mark in usual_deallocation_fn_p, at cp/call.c:6935
    9 |   new A;
      |       ^
0x85a540 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:8686
0x6544a6 tree_check2(tree_node*, char const*, int, char const*, tree_code,
tree_code)
        ../../gcc/gcc/tree.h:3392
0x6544a6 usual_deallocation_fn_p
        ../../gcc/gcc/cp/call.c:6935
0x9229e0 build_op_delete_call(tree_code, tree_node*, tree_node*, bool,
tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/call.c:6926
0xa0c128 build_new_1
        ../../gcc/gcc/cp/init.c:3539
0xa0cf98 build_new(unsigned int, vec<tree_node*, va_gc, vl_embed>**,
tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int, int)
        ../../gcc/gcc/cp/init.c:3826
0xabf7d2 cp_parser_new_expression
        ../../gcc/gcc/cp/parser.c:9157
0xabfdff cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:8745
0xa91a2a cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9893
0xa9233c cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:10197
0xa938b2 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:10367
0xa96f58 cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:12531
0xaa2dff cp_parser_statement
        ../../gcc/gcc/cp/parser.c:12327
0xaa3e9d cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:12679
0xaa3f78 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:12628
0xac35c0 cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:24762
0xac35c0 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:24813
0xac428a cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:30898
0xac56c4 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:30814
0xac56c4 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:22318
Please submit a full bug report, [etc.]

             reply	other threads:[~2021-08-12 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 17:33 reichelt at gcc dot gnu.org [this message]
2021-08-12 20:45 ` [Bug c++/101887] " pinskia at gcc dot gnu.org
2021-08-12 20:46 ` pinskia at gcc dot gnu.org
2021-08-16  8:56 ` rguenth at gcc dot gnu.org
2022-05-27  9:46 ` [Bug c++/101887] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:46 ` jakub at gcc dot gnu.org
2023-07-07 10:40 ` [Bug c++/101887] [11/12/13/14 " rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101887-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).