From: Jason Merrill <jason@redhat.com>
To: Thomas Schwinge <thomas@codesourcery.com>,
Alex Coplan <alex.coplan@arm.com>,
gcc-patches@gcc.gnu.org
Cc: Marek Polacek <polacek@redhat.com>,
Nathan Sidwell <nathan@acm.org>,
Joseph Myers <joseph@codesourcery.com>,
Iain Sandoe <iain@sandoe.co.uk>
Subject: Re: [PATCH v5] c-family: Implement __has_feature and __has_extension [PR60512]
Date: Tue, 28 Nov 2023 12:08:59 -0500 [thread overview]
Message-ID: <fe471a30-8e71-4558-8d7b-75a67e1cf4b3@redhat.com> (raw)
In-Reply-To: <87v89l6f1h.fsf@euler.schwinge.homeip.net>
On 11/28/23 11:03, Thomas Schwinge wrote:
> Hi!
>
> On 2023-11-17T14:50:45+0000, Alex Coplan <alex.coplan@arm.com> wrote:
>> --- a/gcc/cp/cp-objcp-common.cc
>> +++ b/gcc/cp/cp-objcp-common.cc
>
>> +/* Table of features for __has_{feature,extension}. */
>> +
>> +static constexpr cp_feature_info cp_feature_table[] =
>> +{
>> + { "cxx_exceptions", &flag_exceptions },
>> + { "cxx_rtti", &flag_rtti },
>> + { "cxx_access_control_sfinae", { cxx11, cxx98 } },
>
> Here we see that 'cxx_exceptions', 'cxx_rtti' are dependent on
> '-fexceptions', '-frtti'. Certain GCC configurations may decide to
> default to '-fno-exceptions' and/or '-fno-rtti'...
>
>> --- /dev/null
>> +++ b/gcc/testsuite/g++.dg/ext/has-feature.C
>> @@ -0,0 +1,206 @@
>> +// { dg-do compile }
>> +// { dg-options "" }
>> +
>> +#define FEAT(x) (__has_feature(x) && __has_extension(x))
>> +#define CXX11 (__cplusplus >= 201103L)
>> +#define CXX14 (__cplusplus >= 201402L)
>> +
>> +#if !FEAT(cxx_exceptions) || !FEAT(cxx_rtti)
>> +#error
>> +#endif
>
> ..., but here, they are assumed available unconditionally. OK to push
> "Adjust 'g++.dg/ext/has-feature.C' for default-'-fno-exceptions', '-fno-rtti' configurations",
> see attached?
OK.
> Grüße
> Thomas
>
>
> -----------------
> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
prev parent reply other threads:[~2023-11-28 17:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 14:50 Alex Coplan
2023-11-20 22:29 ` Jason Merrill
2023-11-23 17:41 ` Marek Polacek
2023-11-27 10:58 ` Alex Coplan
2023-11-28 8:22 ` [PATCH] c++: Fix up __has_extension (cxx_init_captures) Jakub Jelinek
2023-11-28 16:45 ` Alex Coplan
2023-11-28 17:12 ` Jakub Jelinek
2023-11-28 17:18 ` Jason Merrill
2023-11-28 17:08 ` Jason Merrill
2023-11-28 16:03 ` [PATCH v5] c-family: Implement __has_feature and __has_extension [PR60512] Thomas Schwinge
2023-11-28 16:53 ` Alex Coplan
2023-11-28 17:08 ` Jason Merrill [this message]
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=fe471a30-8e71-4558-8d7b-75a67e1cf4b3@redhat.com \
--to=jason@redhat.com \
--cc=alex.coplan@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=iain@sandoe.co.uk \
--cc=joseph@codesourcery.com \
--cc=nathan@acm.org \
--cc=polacek@redhat.com \
--cc=thomas@codesourcery.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).