From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1C4B63858C01; Sun, 10 Sep 2023 02:16:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C4B63858C01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694312188; bh=jML6sRB3R5UWJvUIqGD2Y27NWJIjzC32QmI6INcdokk=; h=From:To:Subject:Date:From; b=OKWrdPAgPGsvgTKHhHvgeFycuAQPFszftlK+k9Jk0ZAuD6JtMfekBx89VAoQaV3yI oXGD6cb3xbe08NXimWEzdO74aCWUdqpV4ZmvvNWCTbV2MauAVpFtyxtwsmflFZGblr MBMur4/9j7DTi3o61AnPCX86XtbsHl6WdPdNAkDI= From: "frankhb1989 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/111357] New: __integer_pack fails to work with values of dependent type convertible to integers Date: Sun, 10 Sep 2023 02:16:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: frankhb1989 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 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111357 Bug ID: 111357 Summary: __integer_pack fails to work with values of dependent type convertible to integers Product: gcc Version: 13.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: frankhb1989 at gmail dot com Target Milestone: --- Case: #include #include #include using std::size_t; #if __cpp_lib_integer_sequence >=3D 201304L using std::index_sequence; using std::make_index_sequence; #else template struct index_sequence {}; template struct succ; template struct succ> { using type =3D index_sequence; }; template struct iseq { using type =3D typename succ::type>::type; }; template<> struct iseq<0> { using type =3D index_sequence<>; }; template using make_index_sequence =3D typename iseq::type; #endif template void g(index_sequence) {} template struct R { using S =3D make_index_sequence>{}>; R() noexcept(noexcept(g(S()))) {} }; int main() { R(); } Output of x86-64 gcc 13.2 (Compiler #1) : In instantiation of 'R::R() [with T =3D int]': :55:9: required from here :49:33: error: argument to '__integer_pack' must be between 0 and 268435452 49 | R() noexcept(noexcept(g(S()))) | ^~~ This should work as -std=3Dc++11 which uses a naive implementation of make_index_sequence here. I mark it as a libstdc++ bug of conformance for the case. The root cause se= ems a bug of the implementation in the frontend, but I'm not that sure, because= the document of __integer_pack does not mention such cases explicitly. (The err= or message here is obviously confusing, though.)=