public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Tim Shen via gcc-patches" <gcc-patches@gcc.gnu.org>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
		Tim Song <t.canens.cpp@gmail.com>
Subject: Re: [PATCH] PR libstdc++/80939 Remove unmeetable constexpr specifiers
Date: Fri, 02 Jun 2017 19:19:00 -0000	[thread overview]
Message-ID: <CAG4ZjN=0A_7LDVudhxin6VP0b5mCO1QuXt9No2Kcu+vvkLS4tg@mail.gmail.com> (raw)
In-Reply-To: <20170602130734.GA6233@redhat.com>

On Fri, Jun 2, 2017 at 6:07 AM, Jonathan Wakely wrote:
> As the PR points out, we aren't qualifying calls to __ref_cast, and
> have 'constexpr' on function templates that can never be usable in
> constant expressions.

Apology for the constexpr trolling, but that was not intentional. :)

I'm curious why no tests break. Is it because constexpr in a template
function is a no-op instead of a hard error, when the function
definition is not constexpr?

The patch looks good.

>
> This fixes it, and also simplifies __variant::__erased_dtor by using
> std::_Destroy, although that requires including quite a lot more code,
> for iterator_traits and allocator_traits.  If that matters (probably
> not) then <bits/stl_construct.h> could be split up to move _Construct
> and _Destroy to a new <bits/stl_construct_base.h>.  Or maybe I should
> just leave __erased_dtor alone (apart from qualifying the __ref_cast
> call).
>
> Anybody feel strongly either way?
>
>         PR libstdc++/80939
>         * include/std/variant (__erased_ctor, __erased_assign,
> __erased_swap)
>         (__erased_hash): Remove constexpr specifier and qualify calls to
>         __ref_cast.
>         (__erased_dtor): Remove constexpr specifier and use _Destroy.
>
>



-- 
Regards,
Tim Shen

  reply	other threads:[~2017-06-02 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02 13:07 Jonathan Wakely
2017-06-02 19:19 ` Tim Shen via gcc-patches [this message]
2017-06-02 19:40   ` Tim Song
2017-06-05 16:49   ` Jonathan Wakely
2017-06-11  0:15 ` Tim Song

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='CAG4ZjN=0A_7LDVudhxin6VP0b5mCO1QuXt9No2Kcu+vvkLS4tg@mail.gmail.com' \
    --to=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=t.canens.cpp@gmail.com \
    --cc=timshen@google.com \
    /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).