public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421
@ 2020-04-13 19:35 asolokha at gmx dot com
  2020-04-13 23:27 ` [Bug c++/94583] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: asolokha at gmx dot com @ 2020-04-13 19:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94583
           Summary: [10 Regression] ICE in get_defaulted_eh_spec, at
                    cp/method.c:2421
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-10.0.1-alpha20200412 snapshot (g:87be4cecfc6e42390303be1ca92bc8bc587b0bd6)
ICEs when compiling the attached testcase, reduced from
test/CXX/class/class.compare/class.compare.default/p4.cpp from the clang 10.0.0
test suite, w/ -std=c++2a:

namespace std {
  struct strong_ordering {
  };
}

namespace DeleteAfterFirstDecl {
  bool operator==(const struct Q&, const struct Q&);
  struct Q {
    friend std::strong_ordering operator<=>(const Q&, const Q&) = default;
  };
}

% g++-10.0.1 -std=c++2a -c r8gjjctb.cpp
r8gjjctb.cpp:8:10: internal compiler error: in get_defaulted_eh_spec, at
cp/method.c:2421
    8 |   struct Q {
      |          ^
0x633fac get_defaulted_eh_spec(tree_node*, int)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/method.c:2421
0x9fe7e6 maybe_instantiate_noexcept(tree_node*, int)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/pt.c:25157
0x8e52bc check_redeclaration_exception_specification
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/decl.c:1183
0x8f68ef duplicate_decls(tree_node*, tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/decl.c:2202
0x974fb0 do_pushdecl
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/name-lookup.c:3045
0x976ef3 pushdecl(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/name-lookup.c:3174
0x976ef3 do_pushdecl_with_scope
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/name-lookup.c:3856
0x9770d1 pushdecl_namespace_level(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/name-lookup.c:5080
0x937633 do_friend(tree_node*, tree_node*, tree_node*, tree_node*,
overload_flags, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/friend.c:627
0x889e59 add_implicitly_declared_members
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/class.c:3245
0x8910bb check_bases_and_members
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/class.c:5976
0x89569b finish_struct_1(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/class.c:7212
0x8970e4 finish_struct(tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/class.c:7516
0x996533 cp_parser_class_specifier_1
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/parser.c:23878
0x99862b cp_parser_class_specifier
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/parser.c:24177
0x99862b cp_parser_type_specifier
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/parser.c:17708
0x999735 cp_parser_decl_specifier_seq
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/parser.c:14356
0x99a1d4 cp_parser_simple_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/parser.c:13610
0x9c4b32 cp_parser_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/parser.c:13430
0x9c4872 cp_parser_toplevel_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200412/work/gcc-10-20200412/gcc/cp/parser.c:13458

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

* [Bug c++/94583] [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421
  2020-04-13 19:35 [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421 asolokha at gmx dot com
@ 2020-04-13 23:27 ` mpolacek at gcc dot gnu.org
  2020-04-14  4:23 ` mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-13 23:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.0
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2020-04-13
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  Started with r10-6586-gd6ef77e023cfe0bb3b12b88ae46b77da356d7f85,
before that we compiled it fine, as does clang.

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

* [Bug c++/94583] [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421
  2020-04-13 19:35 [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421 asolokha at gmx dot com
  2020-04-13 23:27 ` [Bug c++/94583] " mpolacek at gcc dot gnu.org
@ 2020-04-14  4:23 ` mpolacek at gcc dot gnu.org
  2020-04-14  7:18 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-14  4:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We crash on the assert in get_defaulted_eh_spec:
2417   if (sfk == sfk_comparison)
2418     {
2419       /* We're in synthesize_method. Start with NULL_TREE,
build_comparison_op
2420          will adjust as needed.  */
2421       gcc_assert (decl == current_function_decl);
2422       return NULL_TREE;
2423     }


https://eel.is/c++draft/class.compare#default-5 seems to be relevant:

If the three-way comparison operator function has no noexcept-specifier, the
implicitly-declared == operator function has an implicit exception
specification ([except.spec]) that may differ from the implicit exception
specification of the three-way comparison operator function.

[except.spec]/11 The exception specification for a comparison operator function
([over.binary]) without a noexcept-specifier that is defaulted on its first
declaration is potentially-throwing if and only if any expression in the
implicit definition is potentially-throwing.

The implicit operator== has noexcept_deferred_spec, and unfortunately
synthesized_method_walk doesn't seem to work on sfk_comparison.

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

* [Bug c++/94583] [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421
  2020-04-13 19:35 [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421 asolokha at gmx dot com
  2020-04-13 23:27 ` [Bug c++/94583] " mpolacek at gcc dot gnu.org
  2020-04-14  4:23 ` mpolacek at gcc dot gnu.org
@ 2020-04-14  7:18 ` rguenth at gcc dot gnu.org
  2020-04-20 13:55 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-14  7:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
           Keywords|ice-on-invalid-code         |ice-on-valid-code

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

* [Bug c++/94583] [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421
  2020-04-13 19:35 [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-04-14  7:18 ` rguenth at gcc dot gnu.org
@ 2020-04-20 13:55 ` rguenth at gcc dot gnu.org
  2020-04-23 20:14 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-20 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
While it is a regression on the development "branch" it is a rejects-valid
(not implemented in GCC 9) -> ice-on-valid "regression" only as far as the
GCC 10 release is concerned.

So definitely not release critical.

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

* [Bug c++/94583] [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421
  2020-04-13 19:35 [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-04-20 13:55 ` rguenth at gcc dot gnu.org
@ 2020-04-23 20:14 ` jason at gcc dot gnu.org
  2020-04-25  4:17 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2020-04-23 20:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/94583] [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421
  2020-04-13 19:35 [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2020-04-23 20:14 ` jason at gcc dot gnu.org
@ 2020-04-25  4:17 ` cvs-commit at gcc dot gnu.org
  2020-04-25  4:29 ` jason at gcc dot gnu.org
  2020-04-28 18:38 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-25  4:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:352811870d7d7edcca109ef50822e26ca7ef2b36

commit r10-7957-g352811870d7d7edcca109ef50822e26ca7ef2b36
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Apr 24 16:27:26 2020 -0400

    c++: implicit operator== with previous decl [PR94583]

    P2085 clarified that a defaulted comparison operator must be the first
    declaration of the function.  Rejecting that avoids the ICE trying to
    compare the noexcept-specifications.

    gcc/cp/ChangeLog
    2020-04-24  Jason Merrill  <jason@redhat.com>

            PR c++/94583
            * decl.c (redeclaration_error_message): Reject defaulted comparison
            operator that has been previously declared.

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

* [Bug c++/94583] [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421
  2020-04-13 19:35 [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2020-04-25  4:17 ` cvs-commit at gcc dot gnu.org
@ 2020-04-25  4:29 ` jason at gcc dot gnu.org
  2020-04-28 18:38 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2020-04-25  4:29 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
Fixed.

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

* [Bug c++/94583] [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421
  2020-04-13 19:35 [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421 asolokha at gmx dot com
                   ` (6 preceding siblings ...)
  2020-04-25  4:29 ` jason at gcc dot gnu.org
@ 2020-04-28 18:38 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-28 18:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 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:bce54ed494fd0e61f41986e2bdbcfb2d2a3a1cf1

commit r10-8016-gbce54ed494fd0e61f41986e2bdbcfb2d2a3a1cf1
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Apr 28 12:27:27 2020 -0400

    c++: Redeclaration of implicit operator== [PR94583]

    My last patch rejected a namespace-scope declaration of the
    implicitly-declared friend operator== before the class, but redeclaring it
    after the class should be OK.

    gcc/cp/ChangeLog
    2020-04-28  Jason Merrill  <jason@redhat.com>

            PR c++/94583
            * decl.c (use_eh_spec_block): Check nothrow type after
            DECL_DEFAULTED_FN.
            * pt.c (maybe_instantiate_noexcept): Call synthesize_method for
            DECL_MAYBE_DELETED fns here.
            * decl2.c (mark_used): Not here.
            * method.c (get_defaulted_eh_spec): Reject DECL_MAYBE_DELETED here.

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

end of thread, other threads:[~2020-04-28 18:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 19:35 [Bug c++/94583] New: [10 Regression] ICE in get_defaulted_eh_spec, at cp/method.c:2421 asolokha at gmx dot com
2020-04-13 23:27 ` [Bug c++/94583] " mpolacek at gcc dot gnu.org
2020-04-14  4:23 ` mpolacek at gcc dot gnu.org
2020-04-14  7:18 ` rguenth at gcc dot gnu.org
2020-04-20 13:55 ` rguenth at gcc dot gnu.org
2020-04-23 20:14 ` jason at gcc dot gnu.org
2020-04-25  4:17 ` cvs-commit at gcc dot gnu.org
2020-04-25  4:29 ` jason at gcc dot gnu.org
2020-04-28 18:38 ` cvs-commit 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).