public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95955] New: ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952
@ 2020-06-29 3:21 haoxintu at gmail dot com
2020-07-03 3:48 ` [Bug c++/95955] " haoxintu at gmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: haoxintu at gmail dot com @ 2020-06-29 3:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95955
Bug ID: 95955
Summary: ICE: tree check: expected integer_type or
enumeral_type or boolean_type or real_type or
fixed_point_type, have union_type in int_fits_type_p,
at tree.c:8952
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Keywords: error-recovery, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: haoxintu at gmail dot com
Target Milestone: ---
This code, bug.cc, reduced by C-Reduce, makes GCC-trunk ICE.
$cat bug.cc
enum class a : struct {}
template < < > > enum class a : union b {}
enum class a { c
$g++ bug.cc
bug.cc:1:25: error: expected ‘;’ after struct definition
1 | enum class a : struct {}
| ^
| ;
bug.cc:1:24: error: underlying type ‘<unnamed struct>’ of ‘a’ must be an
integral type
1 | enum class a : struct {}
| ^
bug.cc:2:12: error: expected identifier before ‘<’ token
2 | template < < > > enum class a : union b {}
| ^
bug.cc:2:12: error: expected ‘>’ before ‘<’ token
bug.cc:2:43: error: expected ‘;’ after union definition
2 | template < < > > enum class a : union b {}
| ^
| ;
bug.cc:3:12: error: different underlying type in enum ‘enum class a’
3 | enum class a { c
| ^
bug.cc:1:24: note: previous definition here
1 | enum class a : struct {}
| ^
bug.cc:3:16: internal compiler error: tree check: expected integer_type or
enumeral_type or boolean_type or real_type or fixed_point_type, have union_type
in int_fits_type_p, at tree.c:8952
3 | enum class a { c
| ^
0x7c2dcf tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9685
0x7c9ce1 tree_check5(tree_node const*, char const*, int, char const*,
tree_code, tree_code, tree_code, tree_code, tree_code)
../../gcc/tree.h:3648
0x7c9ce1 int_fits_type_p(tree_node const*, tree_node const*)
../../gcc/tree.c:8952
0x911daa build_enumerator(tree_node*, tree_node*, tree_node*, tree_node*,
unsigned int)
../../gcc/cp/decl.c:15906
0x9a2447 cp_parser_enumerator_definition
../../gcc/cp/parser.c:19545
0x9a2447 cp_parser_enumerator_list
../../gcc/cp/parser.c:19474
0x9a2447 cp_parser_enum_specifier
../../gcc/cp/parser.c:19405
0x9a2447 cp_parser_type_specifier
../../gcc/cp/parser.c:17734
0x9a2a02 cp_parser_decl_specifier_seq
../../gcc/cp/parser.c:14410
0x9a35c1 cp_parser_simple_declaration
../../gcc/cp/parser.c:13664
0x9cc926 cp_parser_declaration
../../gcc/cp/parser.c:13484
0x9cd06a cp_parser_translation_unit
../../gcc/cp/parser.c:4761
0x9cd06a c_parse_file()
../../gcc/cp/parser.c:44043
0xae4dbb c_common_parse_file()
../../gcc/c-family/c-opts.c:1190
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$g++ --version
g++ (GCC) 11.0.0 20200626 (experimental)
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/95955] ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952
2020-06-29 3:21 [Bug c++/95955] New: ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952 haoxintu at gmail dot com
@ 2020-07-03 3:48 ` haoxintu at gmail dot com
2020-07-08 21:42 ` mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: haoxintu at gmail dot com @ 2020-07-03 3:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95955
W E Brown <webrown.cpp at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |webrown.cpp at gmail dot com
--- Comment #1 from Haoxin Tu <haoxintu at gmail dot com> ---
Add a more readable case
$cat p.c
enum class a : struct{};
template < template <class> class A >
enum class a : union b {};
enum class a { c;}
$g++ p.cc
p.cc:1:23: error: underlying type ‘<unnamed struct>’ of ‘a’ must be an integral
type
1 | enum class a : struct{};
| ^
p.cc:4:12: error: different underlying type in enum ‘enum class a’
4 | enum class a { c;}
| ^
p.cc:1:23: note: previous definition here
1 | enum class a : struct{};
| ^
p.cc:4:16: internal compiler error: tree check: expected integer_type or
enumeral_type or boolean_type or real_type or fixed_point_type, have union_type
in int_fits_type_p, at tree.c:8952
4 | enum class a { c;}
| ^
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/95955] ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952
2020-06-29 3:21 [Bug c++/95955] New: ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952 haoxintu at gmail dot com
2020-07-03 3:48 ` [Bug c++/95955] " haoxintu at gmail dot com
@ 2020-07-08 21:42 ` mpolacek at gcc dot gnu.org
2020-07-08 21:44 ` mpolacek at gcc dot gnu.org
2021-08-08 9:07 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-07-08 21:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95955
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
Last reconfirmed| |2020-07-08
Status|UNCONFIRMED |NEW
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/95955] ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952
2020-06-29 3:21 [Bug c++/95955] New: ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952 haoxintu at gmail dot com
2020-07-03 3:48 ` [Bug c++/95955] " haoxintu at gmail dot com
2020-07-08 21:42 ` mpolacek at gcc dot gnu.org
@ 2020-07-08 21:44 ` mpolacek at gcc dot gnu.org
2021-08-08 9:07 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-07-08 21:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95955
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/95955] ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952
2020-06-29 3:21 [Bug c++/95955] New: ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952 haoxintu at gmail dot com
` (2 preceding siblings ...)
2020-07-08 21:44 ` mpolacek at gcc dot gnu.org
@ 2021-08-08 9:07 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-08 9:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95955
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|NEW |RESOLVED
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 96442.
s/union/struct/ in the testcase in comment #0 and you will get exact testcase.
*** This bug has been marked as a duplicate of bug 96442 ***
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-08-08 9:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-29 3:21 [Bug c++/95955] New: ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have union_type in int_fits_type_p, at tree.c:8952 haoxintu at gmail dot com
2020-07-03 3:48 ` [Bug c++/95955] " haoxintu at gmail dot com
2020-07-08 21:42 ` mpolacek at gcc dot gnu.org
2020-07-08 21:44 ` mpolacek at gcc dot gnu.org
2021-08-08 9:07 ` 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).