public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105787] New: internal compiler error: tree check: expected enumeral_type, have record_type in tsubst_copy
@ 2022-05-31  8:25 tamas+gcc@hudson-trading.com
  2022-05-31 13:07 ` [Bug c++/105787] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tamas+gcc@hudson-trading.com @ 2022-05-31  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105787
           Summary: internal compiler error: tree check: expected
                    enumeral_type, have record_type in tsubst_copy
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tamas+gcc@hudson-trading.com
  Target Milestone: ---

The following code causes ICE (at least) on gcc 11.2, 11.3, 12.0 and 13.0.0
20220529 (experimental) when compiling with -std=c++20:

template <typename> class a;
class b;
template <> class a<b> {
public:
  enum class c { d };
  using enum c;
};
class b : public a<b> {};
template <int> class e { char g = (char)b::d; };
e<0> f;

Full error from "13.0.0 20220529":

<source>: In instantiation of 'constexpr e<0>::e()':
<source>:10:6:   required from here
<source>:9:44: internal compiler error: tree check: expected enumeral_type,
have record_type in tsubst_copy, at cp/pt.cc:16944
    9 | template <int> class e { char g = (char)b::d; };
      |                                         ~~~^
0x2200a89 internal_error(char const*, ...)
        ???:0
0x6fa097 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ???:0
0x9c2aea tsubst_tree_list(tree_node*, tree_node*, int, tree_node*)
        ???:0
0x89984c get_nsdmi(tree_node*, bool, int)
        ???:0
0x8cd522 get_defaulted_eh_spec(tree_node*, int)
        ???:0
0x9c2108 maybe_instantiate_noexcept(tree_node*, int)
        ???:0
0x9c2093 maybe_instantiate_noexcept(tree_node*, int)
        ???:0
0x867369 mark_used(tree_node*, int)
        ???:0
0x776f5f build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ???:0
0x778c48 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        ???:0
0x8947ad build_aggr_init(tree_node*, tree_node*, int, int)
        ???:0
0x850c86 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ???:0
0x98cded c_parse_file()
        ???:0
0xb22051 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Godbolt link: https://godbolt.org/z/xcTTs3s3e

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

* [Bug c++/105787] internal compiler error: tree check: expected enumeral_type, have record_type in tsubst_copy
  2022-05-31  8:25 [Bug c++/105787] New: internal compiler error: tree check: expected enumeral_type, have record_type in tsubst_copy tamas+gcc@hudson-trading.com
@ 2022-05-31 13:07 ` mpolacek at gcc dot gnu.org
  2022-07-25 14:55 ` [Bug c++/105787] [10/11/12/13 Regression] ICE in tree check: expected enumeral_type, have record_type in tsubst_copy since r11-5003-gd50310408f54e3 rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-05-31 13:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-05-31

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed, started with r11-5003-gd50310408f54e3:

commit d50310408f54e38031f34931e591c63ff36fee09
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Nov 10 17:17:19 2020 -0500

    c++: Implement C++20 'using enum'.  [PR91367]

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

* [Bug c++/105787] [10/11/12/13 Regression] ICE in tree check: expected enumeral_type, have record_type in tsubst_copy since r11-5003-gd50310408f54e3
  2022-05-31  8:25 [Bug c++/105787] New: internal compiler error: tree check: expected enumeral_type, have record_type in tsubst_copy tamas+gcc@hudson-trading.com
  2022-05-31 13:07 ` [Bug c++/105787] " mpolacek at gcc dot gnu.org
@ 2022-07-25 14:55 ` rguenth at gcc dot gnu.org
  2022-07-25 16:13 ` [Bug c++/105787] " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-25 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.5

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

* [Bug c++/105787] ICE in tree check: expected enumeral_type, have record_type in tsubst_copy since r11-5003-gd50310408f54e3
  2022-05-31  8:25 [Bug c++/105787] New: internal compiler error: tree check: expected enumeral_type, have record_type in tsubst_copy tamas+gcc@hudson-trading.com
  2022-05-31 13:07 ` [Bug c++/105787] " mpolacek at gcc dot gnu.org
  2022-07-25 14:55 ` [Bug c++/105787] [10/11/12/13 Regression] ICE in tree check: expected enumeral_type, have record_type in tsubst_copy since r11-5003-gd50310408f54e3 rguenth at gcc dot gnu.org
@ 2022-07-25 16:13 ` rguenth at gcc dot gnu.org
  2022-10-30 18:53 ` pinskia at gcc dot gnu.org
  2022-10-30 18:54 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-25 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10/11/12/13 Regression]    |ICE in tree check: expected
                   |ICE in tree check: expected |enumeral_type, have
                   |enumeral_type, have         |record_type in tsubst_copy
                   |record_type in tsubst_copy  |since
                   |since                       |r11-5003-gd50310408f54e3
                   |r11-5003-gd50310408f54e3    |
   Target Milestone|10.5                        |---

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
But it's not a regression since it always ICEd when the feature required was
implemented.  GCC 10 rejects the code:

t.ii:6:9: error: expected nested-name-specifier before 'enum'
    6 |   using enum c;
      |         ^~~~
t.ii:9:44: error: 'd' is not a member of 'b'
    9 | template <int> class e { char g = (char)b::d; };
      |                                            ^

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

* [Bug c++/105787] ICE in tree check: expected enumeral_type, have record_type in tsubst_copy since r11-5003-gd50310408f54e3
  2022-05-31  8:25 [Bug c++/105787] New: internal compiler error: tree check: expected enumeral_type, have record_type in tsubst_copy tamas+gcc@hudson-trading.com
                   ` (2 preceding siblings ...)
  2022-07-25 16:13 ` [Bug c++/105787] " rguenth at gcc dot gnu.org
@ 2022-10-30 18:53 ` pinskia at gcc dot gnu.org
  2022-10-30 18:54 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-30 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chris-gcc-bugzilla@cybermat
                   |                            |o.com

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 107460 has been marked as a duplicate of this bug. ***

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

* [Bug c++/105787] ICE in tree check: expected enumeral_type, have record_type in tsubst_copy since r11-5003-gd50310408f54e3
  2022-05-31  8:25 [Bug c++/105787] New: internal compiler error: tree check: expected enumeral_type, have record_type in tsubst_copy tamas+gcc@hudson-trading.com
                   ` (3 preceding siblings ...)
  2022-10-30 18:53 ` pinskia at gcc dot gnu.org
@ 2022-10-30 18:54 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-30 18:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 103081.

*** This bug has been marked as a duplicate of bug 103081 ***

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

end of thread, other threads:[~2022-10-30 18:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-31  8:25 [Bug c++/105787] New: internal compiler error: tree check: expected enumeral_type, have record_type in tsubst_copy tamas+gcc@hudson-trading.com
2022-05-31 13:07 ` [Bug c++/105787] " mpolacek at gcc dot gnu.org
2022-07-25 14:55 ` [Bug c++/105787] [10/11/12/13 Regression] ICE in tree check: expected enumeral_type, have record_type in tsubst_copy since r11-5003-gd50310408f54e3 rguenth at gcc dot gnu.org
2022-07-25 16:13 ` [Bug c++/105787] " rguenth at gcc dot gnu.org
2022-10-30 18:53 ` pinskia at gcc dot gnu.org
2022-10-30 18:54 ` 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).