public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94462] New: ICE in duplicate_decls, at cp/decl.c:1456
@ 2020-04-02 19:43 asolokha at gmx dot com
  2020-04-03  7:12 ` [Bug c++/94462] [10 Regression] ICE in duplicate_decls, at cp/decl.c:1456 since r10-6586-gd6ef77e023cfe0bb marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: asolokha at gmx dot com @ 2020-04-02 19:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94462
           Summary: ICE in duplicate_decls, at cp/decl.c:1456
           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-alpha20200329 snapshot (g:60c254b279e8e8443b8ad26cc46b9e4084cff66c)
ICEs when compiling the following testcase, extracted from
test/CXX/except/except.spec/p11-2a.cpp from the clang 10.0.0 test suite, w/
-std=c++2a:

namespace std {
  struct strong_ordering {
  };
}

namespace Synth {
  struct B {
    friend std::strong_ordering operator<=>(B, B) = default;
  };

  struct C {
    friend bool operator==(C, C);
  };
}

% g++-10.0.1 -std=c++2a -c nfj6urxw.cpp
nfj6urxw.cpp:12:32: internal compiler error: in duplicate_decls, at
cp/decl.c:1456
   12 |     friend bool operator==(C, C);
      |                                ^
0x60bd06 duplicate_decls(tree_node*, tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/decl.c:1456
0x973a60 do_pushdecl
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/name-lookup.c:3045
0x9759a3 pushdecl(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/name-lookup.c:3174
0x9759a3 do_pushdecl_with_scope
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/name-lookup.c:3856
0x975b81 pushdecl_namespace_level(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/name-lookup.c:5080
0x936333 do_friend(tree_node*, tree_node*, tree_node*, tree_node*,
overload_flags, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/friend.c:627
0x90082c grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/decl.c:13363
0x91d4cf grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/decl2.c:841
0x9c1f06 cp_parser_member_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:25331
0x994d61 cp_parser_member_specification_opt
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:24775
0x994d61 cp_parser_class_specifier_1
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:23872
0x996eab cp_parser_class_specifier
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:24179
0x996eab cp_parser_type_specifier
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:17708
0x997fb5 cp_parser_decl_specifier_seq
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:14356
0x998a54 cp_parser_simple_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:13610
0x9c3302 cp_parser_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:13430
0x9c3042 cp_parser_toplevel_declaration
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:13458
0x9c3042 cp_parser_declaration_seq_opt
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:13306
0x9c3042 cp_parser_namespace_body
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:19716
0x9c3042 cp_parser_namespace_definition
       
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200329/work/gcc-10-20200329/gcc/cp/parser.c:19694

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

* [Bug c++/94462] [10 Regression] ICE in duplicate_decls, at cp/decl.c:1456 since r10-6586-gd6ef77e023cfe0bb
  2020-04-02 19:43 [Bug c++/94462] New: ICE in duplicate_decls, at cp/decl.c:1456 asolokha at gmx dot com
@ 2020-04-03  7:12 ` marxin at gcc dot gnu.org
  2020-04-03  7:13 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-03  7:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
            Summary|ICE in duplicate_decls, at  |[10 Regression] ICE in
                   |cp/decl.c:1456              |duplicate_decls, at
                   |                            |cp/decl.c:1456 since
                   |                            |r10-6586-gd6ef77e023cfe0bb
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2020-04-03
           Priority|P3                          |P1
     Ever confirmed|0                           |1
   Target Milestone|---                         |10.0

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r10-6586-gd6ef77e023cfe0bb.

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

* [Bug c++/94462] [10 Regression] ICE in duplicate_decls, at cp/decl.c:1456 since r10-6586-gd6ef77e023cfe0bb
  2020-04-02 19:43 [Bug c++/94462] New: ICE in duplicate_decls, at cp/decl.c:1456 asolokha at gmx dot com
  2020-04-03  7:12 ` [Bug c++/94462] [10 Regression] ICE in duplicate_decls, at cp/decl.c:1456 since r10-6586-gd6ef77e023cfe0bb marxin at gcc dot gnu.org
@ 2020-04-03  7:13 ` marxin at gcc dot gnu.org
  2020-04-06 15:26 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-03  7:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Note that before the revision we accepted the code.

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

* [Bug c++/94462] [10 Regression] ICE in duplicate_decls, at cp/decl.c:1456 since r10-6586-gd6ef77e023cfe0bb
  2020-04-02 19:43 [Bug c++/94462] New: ICE in duplicate_decls, at cp/decl.c:1456 asolokha at gmx dot com
  2020-04-03  7:12 ` [Bug c++/94462] [10 Regression] ICE in duplicate_decls, at cp/decl.c:1456 since r10-6586-gd6ef77e023cfe0bb marxin at gcc dot gnu.org
  2020-04-03  7:13 ` marxin at gcc dot gnu.org
@ 2020-04-06 15:26 ` jason at gcc dot gnu.org
  2020-04-07  4:11 ` cvs-commit at gcc dot gnu.org
  2020-04-07  4:12 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2020-04-06 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

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] 6+ messages in thread

* [Bug c++/94462] [10 Regression] ICE in duplicate_decls, at cp/decl.c:1456 since r10-6586-gd6ef77e023cfe0bb
  2020-04-02 19:43 [Bug c++/94462] New: ICE in duplicate_decls, at cp/decl.c:1456 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-04-06 15:26 ` jason at gcc dot gnu.org
@ 2020-04-07  4:11 ` cvs-commit at gcc dot gnu.org
  2020-04-07  4:12 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-07  4:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:467fc7c83abfe8fca8b75defac7c89f6c75bf9d7

commit r10-7580-g467fc7c83abfe8fca8b75defac7c89f6c75bf9d7
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Apr 6 18:19:07 2020 -0400

    c++: Fix ICE with implicit operator== [PR94462]

    duplicate_decls assumed that any TREE_ARTIFICIAL function at namespace
scope
    was a built-in function, but now in C++20 it's possible to have an
    implicitly declared hidden friend operator==.  We just need to move the
    assert into the if condition.

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

            PR c++/94462
            * decl.c (duplicate_decls): Fix handling of DECL_HIDDEN_FRIEND_P.

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

* [Bug c++/94462] [10 Regression] ICE in duplicate_decls, at cp/decl.c:1456 since r10-6586-gd6ef77e023cfe0bb
  2020-04-02 19:43 [Bug c++/94462] New: ICE in duplicate_decls, at cp/decl.c:1456 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2020-04-07  4:11 ` cvs-commit at gcc dot gnu.org
@ 2020-04-07  4:12 ` jason at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2020-04-07  4:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-04-07  4:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 19:43 [Bug c++/94462] New: ICE in duplicate_decls, at cp/decl.c:1456 asolokha at gmx dot com
2020-04-03  7:12 ` [Bug c++/94462] [10 Regression] ICE in duplicate_decls, at cp/decl.c:1456 since r10-6586-gd6ef77e023cfe0bb marxin at gcc dot gnu.org
2020-04-03  7:13 ` marxin at gcc dot gnu.org
2020-04-06 15:26 ` jason at gcc dot gnu.org
2020-04-07  4:11 ` cvs-commit at gcc dot gnu.org
2020-04-07  4:12 ` 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).