public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [committed] libstdc++: Use reserved name for attribute [PR101055]
Date: Mon, 14 Jun 2021 14:06:40 +0100	[thread overview]
Message-ID: <YMdUYHjL8EusjvDX@redhat.com> (raw)
In-Reply-To: <YMc1Rk2lm08unXfM@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]

On 14/06/21 11:54 +0100, Jonathan Wakely wrote:
>The no_unique_address attribute is not a reserved name until C++20, so
>to use it in C++11/14/17 modes we should use the __no_unique_address_
>form. We already use that form when using the attribute, but not in the
>__has_cpp_attribute check.
>
>libstdc++-v3/ChangeLog:
>
>	PR libstdc++/101055
>	* include/std/tuple: Use reserved form of attribute name.
>	* testsuite/17_intro/headers/c++2011/all_attributes.cc: Add
>	check for no_unique_address.
>	* testsuite/17_intro/headers/c++2014/all_attributes.cc:
>	Likewise.
>	* testsuite/17_intro/headers/c++2017/all_attributes.cc:
>	Likewise.

And this ensures the modified C++17 test doesn't fail when using a
newer -std option.

Tested powerpc64le-linux. Committed to trunk.




[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1224 bytes --]

commit 45fb3d45a4d4b79a00c56fa93e9e69d9d7762ca0
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Jun 14 13:17:40 2021

    libstdc++: Add explicit -std=gnu++17 option to test
    
    This test has no -std option so when the testsuite is run with
    -std=gnu++20 or later, this test will use that. The recent addition of
    no_unique_address will cause it to FAIL, because that's a reserved word
    after C++17. Add an explicit option, so that this test alays uses
    exactly C++17.
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/17_intro/headers/c++2017/all_attributes.cc: Add
            -std=gnu++17 option.

diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc
index 811b3fe3613..ea2c7d20ba2 100644
--- a/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc
+++ b/libstdc++-v3/testsuite/17_intro/headers/c++2017/all_attributes.cc
@@ -15,6 +15,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+// { dg-options "-std=gnu++17" }
 // { dg-do compile { target c++17 } }
 
 // Ensure the library only uses the __name__ form for attributes.

      reply	other threads:[~2021-06-14 13:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-14 10:53 Jonathan Wakely
2021-06-14 13:06 ` Jonathan Wakely [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=YMdUYHjL8EusjvDX@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@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).