public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97895] New: [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255
@ 2020-11-18 16:34 gscfq@t-online.de
  2020-11-18 16:45 ` [Bug c++/97895] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gscfq@t-online.de @ 2020-11-18 16:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97895
           Summary: [11 Regression] ICE in do_auto_deduction, at
                    cp/pt.c:29255
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed recently between 20201018 and 20201108 :


$ cat z1.cc
namespace std {
  template<typename T> struct initializer_list {
    const T *ptr;
    decltype(sizeof 0) n;
  };
  auto a = {};
}


$ g++-11-20201115 -c z1.cc
z1.cc:6:13: internal compiler error: Segmentation fault
    6 |   auto a = {};
      |             ^
0xc727ef crash_signal
        ../../gcc/toplev.c:330
0x7642c1 vec<constructor_elt, va_gc, vl_embed>::end()
        ../../gcc/vec.h:585
0x7642c1 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
        ../../gcc/cp/pt.c:29255
0x6c4cf2 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/cp/decl.c:7570
0x74d7f7 cp_parser_init_declarator
        ../../gcc/cp/parser.c:21362
0x72f42a cp_parser_simple_declaration
        ../../gcc/cp/parser.c:13943
0x75307a cp_parser_declaration
        ../../gcc/cp/parser.c:13640
0x753d34 cp_parser_declaration_seq_opt
        ../../gcc/cp/parser.c:13485
0x753d34 cp_parser_namespace_body
        ../../gcc/cp/parser.c:19955
0x753d34 cp_parser_namespace_definition
        ../../gcc/cp/parser.c:19933
0x752eaf cp_parser_declaration
        ../../gcc/cp/parser.c:13620
0x75390a cp_parser_translation_unit
        ../../gcc/cp/parser.c:4806
0x75390a c_parse_file()
        ../../gcc/cp/parser.c:44595
0x81d252 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1196

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

* [Bug c++/97895] [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255
  2020-11-18 16:34 [Bug c++/97895] New: [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255 gscfq@t-online.de
@ 2020-11-18 16:45 ` mpolacek at gcc dot gnu.org
  2020-11-19  7:34 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-18 16:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2020-11-18
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |11.0
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Mine, started with r11-4547.

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

* [Bug c++/97895] [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255
  2020-11-18 16:34 [Bug c++/97895] New: [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255 gscfq@t-online.de
  2020-11-18 16:45 ` [Bug c++/97895] " mpolacek at gcc dot gnu.org
@ 2020-11-19  7:34 ` rguenth at gcc dot gnu.org
  2020-11-19 18:17 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-19  7:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug c++/97895] [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255
  2020-11-18 16:34 [Bug c++/97895] New: [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255 gscfq@t-online.de
  2020-11-18 16:45 ` [Bug c++/97895] " mpolacek at gcc dot gnu.org
  2020-11-19  7:34 ` rguenth at gcc dot gnu.org
@ 2020-11-19 18:17 ` mpolacek at gcc dot gnu.org
  2020-11-19 18:58 ` cvs-commit at gcc dot gnu.org
  2020-11-19 18:59 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arthur.j.odwyer at gmail dot com

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
*** Bug 97883 has been marked as a duplicate of this bug. ***

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

* [Bug c++/97895] [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255
  2020-11-18 16:34 [Bug c++/97895] New: [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-11-19 18:17 ` mpolacek at gcc dot gnu.org
@ 2020-11-19 18:58 ` cvs-commit at gcc dot gnu.org
  2020-11-19 18:59 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-19 18:58 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:25056bdf94d5f3e66bef039702f7fae799ef16b9

commit r11-5178-g25056bdf94d5f3e66bef039702f7fae799ef16b9
Author: Marek Polacek <polacek@redhat.com>
Date:   Wed Nov 18 22:49:59 2020 -0500

    c++: Fix crash with broken deduction from {} [PR97895]

    Unfortunately, the otherwise beautiful

      for (constructor_elt &elt : *CONSTRUCTOR_ELTS (init))

    is not immune to an empty constructor, so we have to check
    CONSTRUCTOR_ELTS first.

    gcc/cp/ChangeLog:

            PR c++/97895
            * pt.c (do_auto_deduction): Don't crash when the constructor has
            zero elements.

    gcc/testsuite/ChangeLog:

            PR c++/97895
            * g++.dg/cpp0x/auto54.C: New test.

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

* [Bug c++/97895] [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255
  2020-11-18 16:34 [Bug c++/97895] New: [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-11-19 18:58 ` cvs-commit at gcc dot gnu.org
@ 2020-11-19 18:59 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-19 18:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-11-19 18:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 16:34 [Bug c++/97895] New: [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255 gscfq@t-online.de
2020-11-18 16:45 ` [Bug c++/97895] " mpolacek at gcc dot gnu.org
2020-11-19  7:34 ` rguenth at gcc dot gnu.org
2020-11-19 18:17 ` mpolacek at gcc dot gnu.org
2020-11-19 18:58 ` cvs-commit at gcc dot gnu.org
2020-11-19 18:59 ` mpolacek 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).