From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C80913858D39; Sat, 20 Nov 2021 18:54:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C80913858D39 From: "johelegp at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103341] New: ICE type of variable instantiation constrained on template parameter Date: Sat, 20 Nov 2021 18:54:43 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: johelegp at gmail dot com 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 bug_severity priority component assigned_to reporter cc 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: Sat, 20 Nov 2021 18:54:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103341 Bug ID: 103341 Summary: ICE type of variable instantiation constrained on template parameter Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: johelegp at gmail dot com CC: johelegp at gmail dot com Target Milestone: --- See https://godbolt.org/z/68GYeKqK4. ```C++ template struct is_same { }; template concept same_as =3D is_same::value; template inline constexpr same_as auto trait_v{1}; using _ [[maybe_unused]] =3D decltype(trait_v); ``` Output: ``` : In instantiation of 'constexpr const auto [requires ::same_as<, T>] trait_v': :4:37: required from here :3:52: internal compiler error: tree check: accessed elt 1 of 'tree_vec' with 0 elts in hash, at cp/constraint.cc:2503 3 | template inline constexpr same_as auto trait_v{1}; | ^~~~~~~ 0x206d4e9 internal_error(char const*, ...) ???:0 0x6da40c tree_vec_elt_check_failed(int, int, char const*, int, char const*) ???:0 0x85fca0 sat_hasher::hash(sat_entry*) ???:0 0x85aed7 satisfaction_cache::satisfaction_cache(tree_node*, tree_node*, sat_info) ???:0 0x85f01a constraints_satisfied_p(tree_node*, tree_node*) ???:0 0xa3384b do_auto_deduction(tree_node*, tree_node*, tree_node*, int, auto_deduction_context, tree_node*, int) ???:0 0x8d2c1d cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int) ???:0 0xa46987 instantiate_decl(tree_node*, bool, bool) ???:0 0x8e7c9e maybe_instantiate_decl(tree_node*) ???:0 0x8e9760 mark_used(tree_node*, int) ???:0 0xabe557 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kin= d*, bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int) ???:0 0xa0cc65 c_parse_file() ???:0 0xb94bf2 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. Compiler returned: 1 ```=