From: Tim Song <t.canens.cpp@gmail.com>
To: Tim Shen <timshen@google.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
"libstdc++" <libstdc++@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR libstdc++/80939 Remove unmeetable constexpr specifiers
Date: Fri, 02 Jun 2017 19:40:00 -0000 [thread overview]
Message-ID: <CAPQZVxv2JEUXDsPag7tw5Tx1iVi7ZTHp2PMjiKymS2fRX22xGg@mail.gmail.com> (raw)
In-Reply-To: <CAG4ZjN=0A_7LDVudhxin6VP0b5mCO1QuXt9No2Kcu+vvkLS4tg@mail.gmail.com>
On Fri, Jun 2, 2017 at 3:19 PM, Tim Shen <timshen@google.com> wrote:
> 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.
>
A non-template, non-default constexpr function that can never be used
in a constant expression is ill-formed NDR. ([dcl.constexpr]/5)
A constexpr function template for which no specialization that
satisfies the requirements for a constexpr function (when considered
as a non-template) can be generated is ill-formed NDR.
([dcl.constexpr]/6)
It's not really clear to me whether the second rule incorporates the
first or if it's just talking about the requirements in
[dcl.constexpr]/3, but regardless it's not required to break.
next prev parent reply other threads:[~2017-06-02 19:40 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
2017-06-02 19:40 ` Tim Song [this message]
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=CAPQZVxv2JEUXDsPag7tw5Tx1iVi7ZTHp2PMjiKymS2fRX22xGg@mail.gmail.com \
--to=t.canens.cpp@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jwakely@redhat.com \
--cc=libstdc++@gcc.gnu.org \
--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).