public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101405] New: internal compiler error: in reshape_init_class, at cp/decl.c:6483
@ 2021-07-10 20:37 carlo at gcc dot gnu.org
  2021-07-12 13:46 ` [Bug c++/101405] [12 Regression] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: carlo at gcc dot gnu.org @ 2021-07-10 20:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101405
           Summary: internal compiler error: in reshape_init_class, at
                    cp/decl.c:6483
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: carlo at gcc dot gnu.org
  Target Milestone: ---

Invalid code.

struct A {
  int const a = 1;
  int const b = 2;
};

struct B : A {
  using A::a;
  using A::b;
  int const c = 3;
  int const d = 4;
};

int main()
{
  [[maybe_unused]] B b =
  {
      .a = 10,
      .d = 42
  };
}

Result:

prog.cc: In function 'int main()':
prog.cc:19:3: internal compiler error: in reshape_init_class, at cp/decl.c:6483
   19 |   };
      |   ^
0x5ffc9b reshape_init_class
        ../../source/gcc/cp/decl.c:6483
0x5ffc9b reshape_init_r
        ../../source/gcc/cp/decl.c:6791
0x6b19ac reshape_init(tree_node*, tree_node*, int)
        ../../source/gcc/cp/decl.c:6867
0x6b3e12 check_initializer
        ../../source/gcc/cp/decl.c:7064
0x6c7978 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../source/gcc/cp/decl.c:8101
0x7823d7 cp_parser_init_declarator
        ../../source/gcc/cp/parser.c:22258
0x760a04 cp_parser_simple_declaration
        ../../source/gcc/cp/parser.c:14801
0x76282d cp_parser_declaration_statement
        ../../source/gcc/cp/parser.c:13936
0x762ba6 cp_parser_statement
        ../../source/gcc/cp/parser.c:12066
0x763d2d cp_parser_statement_seq_opt
        ../../source/gcc/cp/parser.c:12433
0x763de0 cp_parser_compound_statement
        ../../source/gcc/cp/parser.c:12382
0x78051a cp_parser_function_body
        ../../source/gcc/cp/parser.c:24448
0x78051a cp_parser_ctor_initializer_opt_and_function_body
        ../../source/gcc/cp/parser.c:24499
0x78174a cp_parser_function_definition_after_declarator
        ../../source/gcc/cp/parser.c:30572
0x7828ac cp_parser_function_definition_from_specifiers_and_declarator
        ../../source/gcc/cp/parser.c:30488
0x7828ac cp_parser_init_declarator
        ../../source/gcc/cp/parser.c:22020
0x760a04 cp_parser_simple_declaration
        ../../source/gcc/cp/parser.c:14801
0x78b715 cp_parser_declaration
        ../../source/gcc/cp/parser.c:14498
0x78c3a6 cp_parser_toplevel_declaration
        ../../source/gcc/cp/parser.c:14527
0x78c3a6 cp_parser_translation_unit
        ../../source/gcc/cp/parser.c:4958
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Tested on https://wandbox.org/permlink/I8cRHJ2jAk9Op94a

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

* [Bug c++/101405] [12 Regression] internal compiler error: in reshape_init_class, at cp/decl.c:6483
  2021-07-10 20:37 [Bug c++/101405] New: internal compiler error: in reshape_init_class, at cp/decl.c:6483 carlo at gcc dot gnu.org
@ 2021-07-12 13:46 ` jakub at gcc dot gnu.org
  2021-11-16 22:27 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-12 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-07-12
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org
   Target Milestone|---                         |12.0
           Priority|P3                          |P1
     Ever confirmed|0                           |1
            Summary|internal compiler error: in |[12 Regression] internal
                   |reshape_init_class, at      |compiler error: in
                   |cp/decl.c:6483              |reshape_init_class, at
                   |                            |cp/decl.c:6483

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r12-954-g84fd1b5dff70cd74aee7e8b18f66959d8b8e1ce7

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

* [Bug c++/101405] [12 Regression] internal compiler error: in reshape_init_class, at cp/decl.c:6483
  2021-07-10 20:37 [Bug c++/101405] New: internal compiler error: in reshape_init_class, at cp/decl.c:6483 carlo at gcc dot gnu.org
  2021-07-12 13:46 ` [Bug c++/101405] [12 Regression] " jakub at gcc dot gnu.org
@ 2021-11-16 22:27 ` mpolacek at gcc dot gnu.org
  2022-01-20 13:47 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-11-16 22:27 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
           Priority|P1                          |P2
           Keywords|ice-on-valid-code           |ice-on-invalid-code

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Invalid -> P2.

$ xg++-10 -c 101405.C
101405.C: In function ‘int main()’:
101405.C:19:3: error: could not convert ‘{10, 42}’ from ‘<brace-enclosed
initializer list>’ to ‘B’
   19 |   };
      |   ^
      |   |
      |   <brace-enclosed initializer list>

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

* [Bug c++/101405] [12 Regression] internal compiler error: in reshape_init_class, at cp/decl.c:6483
  2021-07-10 20:37 [Bug c++/101405] New: internal compiler error: in reshape_init_class, at cp/decl.c:6483 carlo at gcc dot gnu.org
  2021-07-12 13:46 ` [Bug c++/101405] [12 Regression] " jakub at gcc dot gnu.org
  2021-11-16 22:27 ` mpolacek at gcc dot gnu.org
@ 2022-01-20 13:47 ` jason at gcc dot gnu.org
  2022-01-20 14:52 ` ppalka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2022-01-20 13:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

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

* [Bug c++/101405] [12 Regression] internal compiler error: in reshape_init_class, at cp/decl.c:6483
  2021-07-10 20:37 [Bug c++/101405] New: internal compiler error: in reshape_init_class, at cp/decl.c:6483 carlo at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-01-20 13:47 ` jason at gcc dot gnu.org
@ 2022-01-20 14:52 ` ppalka at gcc dot gnu.org
  2022-01-20 20:24 ` cvs-commit at gcc dot gnu.org
  2022-01-20 20:29 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-01-20 14:52 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Jason, please feel free to look at the other PRs in this area

  PR101767
  PR102538
  PR102740
  PR103299

including the ones I'm assigned to (the last 3) which are probably all
manifestations of the same bug.  I'm afraid I'm a bit stumped as to how to fix
these :/

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

* [Bug c++/101405] [12 Regression] internal compiler error: in reshape_init_class, at cp/decl.c:6483
  2021-07-10 20:37 [Bug c++/101405] New: internal compiler error: in reshape_init_class, at cp/decl.c:6483 carlo at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-01-20 14:52 ` ppalka at gcc dot gnu.org
@ 2022-01-20 20:24 ` cvs-commit at gcc dot gnu.org
  2022-01-20 20:29 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-20 20:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

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

commit r12-6779-gcc01cd9397fe99e707bcc5b98bb33d807ba610d7
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Jan 20 09:18:45 2022 -0500

    c++: designator for base class member [PR101405]

    A C++20 designator must name a direct non-static member of the class; in
    this case it names a member of a base class, and we should give an error
    instead of crashing.

            PR c++/101405

    gcc/cp/ChangeLog:

            * decl.cc (reshape_init_class): Reject designator for a member of
            another class.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/desig20.C: New test.

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

* [Bug c++/101405] [12 Regression] internal compiler error: in reshape_init_class, at cp/decl.c:6483
  2021-07-10 20:37 [Bug c++/101405] New: internal compiler error: in reshape_init_class, at cp/decl.c:6483 carlo at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-01-20 20:24 ` cvs-commit at gcc dot gnu.org
@ 2022-01-20 20:29 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2022-01-20 20:29 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Patrick Palka from comment #3)
> Jason, please feel free to look at the other PRs in this area

Leaving those to Marek as discussed separately.  This PR is now fixed, but the
patch seems unlikely to help with the others.

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

end of thread, other threads:[~2022-01-20 20:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-10 20:37 [Bug c++/101405] New: internal compiler error: in reshape_init_class, at cp/decl.c:6483 carlo at gcc dot gnu.org
2021-07-12 13:46 ` [Bug c++/101405] [12 Regression] " jakub at gcc dot gnu.org
2021-11-16 22:27 ` mpolacek at gcc dot gnu.org
2022-01-20 13:47 ` jason at gcc dot gnu.org
2022-01-20 14:52 ` ppalka at gcc dot gnu.org
2022-01-20 20:24 ` cvs-commit at gcc dot gnu.org
2022-01-20 20:29 ` jason 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).