public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98352] New: [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914
@ 2020-12-17 16:45 gscfq@t-online.de
  2020-12-18  8:43 ` [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2020-12-17 16:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98352
           Summary: [9/10/11 Regression] ICE in implicitly_declare_fn, at
                    cp/method.c:2914
           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 between 20190217 and 20190224, and affects roughly
a dozen testsuite files when running without -std=c++11 :


$ cat z1_nsdmi-defer6.C
struct A
{
  int i = (A(), 42);
};
A a;


$ g++-11-20201213 -c z1_nsdmi-defer6.C -ansi
z1_nsdmi-defer6.C:3:19: warning: non-static data member initializers only
available with '-std=c++11' or '-std=gnu++11'
    3 |   int i = (A(), 42);
      |                   ^
z1_nsdmi-defer6.C:3:14: internal compiler error: in implicitly_declare_fn, at
cp/method.c:2914
    3 |   int i = (A(), 42);
      |              ^
0x7f19a0 implicitly_declare_fn(special_function_kind, tree_node*, bool,
tree_node*, tree_node*)
        ../../gcc/cp/method.c:2914
0x7f24a5 lazily_declare_fn(special_function_kind, tree_node*)
        ../../gcc/cp/method.c:3209
0x7ff9fc maybe_lazily_declare
        ../../gcc/cp/name-lookup.c:1922
0x7ff9fc get_class_binding(tree_node*, tree_node*, bool)
        ../../gcc/cp/name-lookup.c:1952
0x8f406b lookup_field_r
        ../../gcc/cp/search.c:978
0x8f2a4e dfs_walk_all(tree_node*, tree_node* (*)(tree_node*, void*), tree_node*
(*)(tree_node*, void*), void*)
        ../../gcc/cp/search.c:1408
0x8f2bfc lookup_member(tree_node*, tree_node*, int, bool, int,
access_failure_info*)
        ../../gcc/cp/search.c:1121
0x8f2fa0 lookup_fnfields(tree_node*, tree_node*, int, int)
        ../../gcc/cp/search.c:1327
0x6b1950 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        ../../gcc/cp/call.c:9958
0x7bc8f6 build_value_init(tree_node*, int)
        ../../gcc/cp/init.c:355
0x9745bd build_functional_cast_1
        ../../gcc/cp/typeck2.c:2264
0x9745bd build_functional_cast(unsigned int, tree_node*, tree_node*, int)
        ../../gcc/cp/typeck2.c:2286
0x82f287 cp_parser_functional_cast
        ../../gcc/cp/parser.c:30524
0x843b92 cp_parser_postfix_expression
        ../../gcc/cp/parser.c:7417
0x858cf5 cp_parser_unary_expression
        ../../gcc/cp/parser.c:8808
0x8286ef cp_parser_cast_expression
        ../../gcc/cp/parser.c:9712
0x828fb1 cp_parser_binary_expression
        ../../gcc/cp/parser.c:9814
0x8299e0 cp_parser_assignment_expression
        ../../gcc/cp/parser.c:10118
0x82b409 cp_parser_expression
        ../../gcc/cp/parser.c:10288
0x840b4d cp_parser_primary_expression
        ../../gcc/cp/parser.c:5556

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

* [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e
  2020-12-17 16:45 [Bug c++/98352] New: [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 gscfq@t-online.de
@ 2020-12-18  8:43 ` marxin at gcc dot gnu.org
  2021-01-05  8:32 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-12-18  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
            Summary|[9/10/11 Regression] ICE in |[9/10/11 Regression] ICE in
                   |implicitly_declare_fn, at   |implicitly_declare_fn, at
                   |cp/method.c:2914            |cp/method.c:2914 since
                   |                            |r9-6097-g9d35a27a8353b57e
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2020-12-18
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, started with r9-6097-g9d35a27a8353b57e.

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

* [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e
  2020-12-17 16:45 [Bug c++/98352] New: [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 gscfq@t-online.de
  2020-12-18  8:43 ` [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e marxin at gcc dot gnu.org
@ 2021-01-05  8:32 ` rguenth at gcc dot gnu.org
  2021-01-14 11:12 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-05  8:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.4

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

* [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e
  2020-12-17 16:45 [Bug c++/98352] New: [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 gscfq@t-online.de
  2020-12-18  8:43 ` [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e marxin at gcc dot gnu.org
  2021-01-05  8:32 ` rguenth at gcc dot gnu.org
@ 2021-01-14 11:12 ` rguenth at gcc dot gnu.org
  2021-03-12  0:48 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-14 11:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e
  2020-12-17 16:45 [Bug c++/98352] New: [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2021-01-14 11:12 ` rguenth at gcc dot gnu.org
@ 2021-03-12  0:48 ` mpolacek at gcc dot gnu.org
  2021-03-26 20:15 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-12  0:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
My patch for PR94751 will fix this too if it's tweaked like this:

--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -3002,7 +3002,7 @@ implicitly_declare_fn (special_function_kind kind, tree
type,
         member initializer (c++/89914).  Also, in C++98, we might have
         failed to deduce RAISES, so try again but complain this time.  */
      if (cxx_dialect < cxx11)
-       synthesized_method_walk (type, kind, const_p, nullptr, nullptr,
+       synthesized_method_walk (type, kind, const_p, &raises, nullptr,
                     nullptr, nullptr, /*diag=*/true,
                     &inherited_ctor, inherited_parms);
      /* We should have seen an error at this point.  */

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

* [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e
  2020-12-17 16:45 [Bug c++/98352] New: [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2021-03-12  0:48 ` mpolacek at gcc dot gnu.org
@ 2021-03-26 20:15 ` cvs-commit at gcc dot gnu.org
  2021-03-26 20:21 ` mpolacek at gcc dot gnu.org
  2024-04-15 23:19 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-26 20:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:c453a817129c2c362726a9773390419f1df7dda3

commit r11-7868-gc453a817129c2c362726a9773390419f1df7dda3
Author: Marek Polacek <polacek@redhat.com>
Date:   Fri Mar 26 11:20:03 2021 -0400

    c++: ICE on invalid with NSDMI in C++98 [PR98352]

    NSDMIs are a C++11 thing, and here we ICE with them on the non-C++11
    path.  Fortunately all we need is a small tweak to my recent r11-7835
    patch.

    gcc/cp/ChangeLog:

            PR c++/98352
            * method.c (implicitly_declare_fn): Pass &raises to
            synthesized_method_walk.

    gcc/testsuite/ChangeLog:

            PR c++/98352
            * g++.dg/cpp0x/inh-ctor37.C: Remove dg-error.
            * g++.dg/cpp0x/nsdmi17.C: New test.

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

* [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e
  2020-12-17 16:45 [Bug c++/98352] New: [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2021-03-26 20:15 ` cvs-commit at gcc dot gnu.org
@ 2021-03-26 20:21 ` mpolacek at gcc dot gnu.org
  2024-04-15 23:19 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-26 20:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e
  2020-12-17 16:45 [Bug c++/98352] New: [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2021-03-26 20:21 ` mpolacek at gcc dot gnu.org
@ 2024-04-15 23:19 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-15 23:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |11.0

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

end of thread, other threads:[~2024-04-15 23:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 16:45 [Bug c++/98352] New: [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 gscfq@t-online.de
2020-12-18  8:43 ` [Bug c++/98352] [9/10/11 Regression] ICE in implicitly_declare_fn, at cp/method.c:2914 since r9-6097-g9d35a27a8353b57e marxin at gcc dot gnu.org
2021-01-05  8:32 ` rguenth at gcc dot gnu.org
2021-01-14 11:12 ` rguenth at gcc dot gnu.org
2021-03-12  0:48 ` mpolacek at gcc dot gnu.org
2021-03-26 20:15 ` cvs-commit at gcc dot gnu.org
2021-03-26 20:21 ` mpolacek at gcc dot gnu.org
2024-04-15 23:19 ` pinskia 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).