From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 966F23861962; Thu, 12 Aug 2021 07:47:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 966F23861962 From: "enrico.seiler at hotmail dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100474] ICE: in diagnose_trait_expr, at cp/constraint.cc:3706 Date: Thu, 12 Aug 2021 07:47:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: enrico.seiler at hotmail dot de 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: cc Message-ID: In-Reply-To: References: 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, 12 Aug 2021 07:47:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100474 Enrico Seiler changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |enrico.seiler at hotmail d= ot de --- Comment #2 from Enrico Seiler --- Here is a version not dependent on range-v3: https://godbolt.org/z/PvdhxGo5c ``` template concept foo =3D __is_constructible(T, Args...); class S { public: S() =3D delete; S(S const &) =3D default; S(S &&) =3D default; S & operator=3D(S const &) =3D default; S & operator=3D(S &&) =3D default; ~S() =3D default; }; int main() { // static_assert(!__is_constructible(S)); // OK // static_assert(!foo); // OK // static_assert(__is_constructible(S)); // FAILS static_assert(foo); // ICE } ``` The parameter pack is not necessary for the ICE to occur, however, it is wh= at META_IS_CONSTRUCTIBLE is expanded to in range-v3. Using `concept foo =3D static_cast(__is_constructible(T, Args...));` = will remove the ICE, even though `__is_constructible` should already return a bo= ol.=