public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/99968] ICE on remove_const_t<incomplete enum type> in requires-expression
Date: Thu, 08 Apr 2021 11:09:14 +0000	[thread overview]
Message-ID: <bug-99968-4-LAPmoeqtcT@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99968-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99968

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:43ab1dc24abd6fded8d5bf6547f0de6851beb200

commit r11-8039-g43ab1dc24abd6fded8d5bf6547f0de6851beb200
Author: Jonathan Wakely <jwakely@redhat.com>
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<const _Tp> to handle const types.

    libstdc++-v3/ChangeLog:

            * include/std/type_traits (is_scoped_enum<T>): Constrain partial
            specialization to not match incomplete enum types. Use a
            requires-expression instead of instantiating is_convertible.
            (is_scoped_enum<const T>): Add as workaround for PR c++/99968.
            * testsuite/20_util/is_scoped_enum/value.cc: Check with
            incomplete types and opaque-enum-declarations.

  parent reply	other threads:[~2021-04-08 11:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 10:37 [Bug c++/99968] New: [11 Regression] " redi at gcc dot gnu.org
2021-04-08 10:38 ` [Bug c++/99968] " redi at gcc dot gnu.org
2021-04-08 10:58 ` redi at gcc dot gnu.org
2021-04-08 11:00 ` [Bug c++/99968] [10/11 " mpolacek at gcc dot gnu.org
2021-04-08 11:06 ` [Bug c++/99968] " redi at gcc dot gnu.org
2021-04-08 11:09 ` cvs-commit at gcc dot gnu.org [this message]
2021-04-08 11:11 ` mpolacek at gcc dot gnu.org
2021-04-09 13:59 ` ppalka at gcc dot gnu.org
2021-04-09 14:01 ` ppalka at gcc dot gnu.org
2021-12-12  6:39 ` pinskia at gcc dot gnu.org
2021-12-28  4:52 ` jason at gcc dot gnu.org
2021-12-28 17:46 ` cvs-commit at gcc dot gnu.org
2022-09-01 10:50 ` redi at gcc dot gnu.org
2022-09-01 14:48 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99968-4-LAPmoeqtcT@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).