From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 16E273857830; Thu, 8 Apr 2021 11:09:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16E273857830 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99968] ICE on remove_const_t in requires-expression Date: Thu, 08 Apr 2021 11:09:14 +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: 11.0 X-Bugzilla-Keywords: ice-checking, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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, 08 Apr 2021 11:09:15 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99968 --- Comment #4 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:43ab1dc24abd6fded8d5bf6547f0de6851beb200 commit r11-8039-g43ab1dc24abd6fded8d5bf6547f0de6851beb200 Author: Jonathan Wakely Date: Thu Apr 8 10:50:57 2021 +0100 libstdc++: Make std::is_scoped_enum work with incomplete types Tim Song pointed out that using __underlying_type is ill-formed for incomplete enumeration types, and is_scoped_enum doesn't require a complete type. This changes the trait to check for conversion to int instead of to the underlying type. In order to give the correct result when the trait is used in the enumerator-list of an incomplete type the partial specialization for enums has an additional check that fails for incomplete types. This assumes that an incompelte enumeration type must be an unscoped enumeration, and so the primary template (with a std::false_type base characteristic) can be used. This isn't necessarily true, but it is not currently possible to refer to a scoped enumeration type before its type is complete (PR c++/89025). It should be possible to use requires(remove_cv_t<_Tp> __t) in the partial specialization's assignablility check, but that currently gives an ICE (PR c++/99968) so there is an extra partial specialization of is_scoped_enum to handle const types. libstdc++-v3/ChangeLog: * include/std/type_traits (is_scoped_enum): Constrain partial specialization to not match incomplete enum types. Use a requires-expression instead of instantiating is_convertible. (is_scoped_enum): Add as workaround for PR c++/99968. * testsuite/20_util/is_scoped_enum/value.cc: Check with incomplete types and opaque-enum-declarations.=