public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Jason Merrill <jason@redhat.com>, gcc Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] c++: Add C++23 consteval if support - P1938R3 [PR100974]
Date: Thu, 10 Jun 2021 11:24:43 +0100	[thread overview]
Message-ID: <CACb0b4=i+U+5xyBREbSdxr93zAzUrjwO1S3RvopmN+F9W9OEvw@mail.gmail.com> (raw)
In-Reply-To: <20210610083416.GC7746@tucnak>

On Thu, 10 Jun 2021 at 09:34, Jakub Jelinek wrote:
> Also, the paper doesn't contain the exact __cpp_if_consteval value,

Right, proposals aren't supposed to, because the value gets set when
the proposal is voted into the working draft (which the proposal
author doesn't control).

> but https://github.com/cplusplus/draft/pull/4660/files mentions 202106L
> which this patch uses.

That's the right value.

> And I'm not changing the libstdc++ side, where perhaps we could change
> std::is_constant_evaluated definition for
> #ifdef __cpp_if_consteval
> case to if consteval { return true; } else { return false; }
> but we need to keep it defined to __builtin_is_constant_evaluated ()
> for C++20 or older.

Is there any advantage to changing that (cheaper for GCC to evaluate?)
or should we just continue to use the __builtin unconditionally?

I suppose it's theoretically possible that there could be a non-GCC
compiler where defined(__cpp_if_consteval) is true but
__has_builtin(__builtin_is_constant_evaluated) is false.


  reply	other threads:[~2021-06-10 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10  8:34 Jakub Jelinek
2021-06-10 10:24 ` Jonathan Wakely [this message]
2021-06-10 10:34   ` Jakub Jelinek
2021-06-10 10:43     ` Jonathan Wakely
2021-06-10 14:09 ` Jason Merrill
2021-06-10 14:44   ` Jakub Jelinek
2021-06-10 17:25     ` Jakub Jelinek
2021-06-10 19:00     ` Jason Merrill
2021-06-11 10:28       ` [PATCH v2] " Jakub Jelinek
2021-06-11 12:49         ` Jason Merrill

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='CACb0b4=i+U+5xyBREbSdxr93zAzUrjwO1S3RvopmN+F9W9OEvw@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.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).