From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 885323854833; Thu, 8 Apr 2021 10:37:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 885323854833 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99968] New: [11 Regression] ICE on remove_const_t in requires-expression Date: Thu, 08 Apr 2021 10:37:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2021 10:37:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99968 Bug ID: 99968 Summary: [11 Regression] ICE on remove_const_t in requires-expression Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- template struct remove_const { using type =3D T; }; template struct remove_const { using type =3D T; }; template using remove_const_t =3D typename remove_const::typ= e; template constexpr inline bool is_enum_v =3D __is_enum(T); template struct is_scoped_enum { static constexpr bool value =3D false; }; template requires is_enum_v && requires (remove_const_t t) { t =3D t; } struct is_scoped_enum { static constexpr bool value =3D !requires (T t, int i) { i =3D t; }; }; template constexpr inline bool is_scoped_enum_v =3D is_scoped_enum::value; void f() { enum E { e0 =3D is_enum_v, e1 =3D is_scoped_enum_v }; static_assert( e0 ); static_assert( ! e1 ); } Compiled with -std=3Dgnu++20: e.C: In instantiation of 'struct remove_const': e.C:3:28: required by substitution of 'template using remove_con= st_t =3D typename remove_const::type [with T =3D f()::E]' e.C:15:26: required by substitution of 'template requires (is_enum_v) && requires(typename remove_const::type t) {t =3D t;} str= uct is_scoped_enum [with T =3D f()::E]' e.C:22:61: required from 'constexpr const bool is_scoped_enum_v' e.C:26:36: required from here e.C:1:29: error: enum value type is not 'INTEGER_TYPE' nor convertible to t= he enum 1 | template struct remove_const { using type =3D T; }; | ^~~~~~~~~~~~ unit-size align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type 0x7fcf7f4c1b28 precision:1 min max > readonly constant VOID e.C:26:12 align:1 warn_if_not_align:0 context initial chain > > > value readonly constant VOID e.C:26:12 align:1 warn_if_not_align:0 context initial chain >> context chain > e.C:1:29: internal compiler error: 'verify_type' failed 0x1385d10 verify_type(tree_node const*) /home/jwakely/src/gcc/gcc/gcc/tree.c:14926 0xcdd13d gen_type_die_with_usage /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25731 0xcdeaa6 gen_type_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25962 0xcdf01c modified_type_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:13727 0xce29f1 add_type_attribute /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:21910 0xcf78da gen_typedef_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25638 0xcf78da gen_typedef_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25572 0xcd9f8a gen_decl_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:26604 0xcdc18d gen_member_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25415 0xcdc18d gen_struct_or_union_type_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25511 0xcdc18d gen_tagged_type_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25712 0xcdd42a gen_tagged_type_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25666 0xcdd42a gen_type_die_with_usage /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25907 0xcdeaa6 gen_type_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:25962 0xcd9a52 gen_decl_die /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:26601 0xcdac53 dwarf2out_decl /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:27156 0xcdb1e1 dwarf2out_type_decl /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:26874 0xcdb1e1 dwarf2out_type_decl /home/jwakely/src/gcc/gcc/gcc/dwarf2out.c:26869 0xfc7994 rest_of_type_compilation(tree_node*, int) /home/jwakely/src/gcc/gcc/gcc/passes.c:339 0x8fdc63 finish_struct_1(tree_node*) /home/jwakely/src/gcc/gcc/gcc/cp/class.c:7548 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.=