From patchwork Mon Jun 14 10:53:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1491634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=EryH7CaQ; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G3Sys4r3Bz9sVb for ; Mon, 14 Jun 2021 20:55:16 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C15EF388A420 for ; Mon, 14 Jun 2021 10:55:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C15EF388A420 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1623668112; bh=vTRnK1VXu35XSiOOAOxuYNU92IYMQSJqOnn2m2YXCiU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=EryH7CaQGMI+CGX7vwhRmPSG1PP3dfKN4DAUg+T9orEDhvNUQU6hzUjMFAmiGKGqw isiz4cppS17Ucn+IwHVaRCwzpuCfGKLnB/HV/7WCEwmi8ghEKsmVd8Mk+ow6nvPm+f iI9LDRewUwiMq7Ivk4eQAiiWZAyQzh0Yt0Od/KIY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id E1D9C384840F for ; Mon, 14 Jun 2021 10:54:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E1D9C384840F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-371-05iMCcT2P-mE1vrM2jaWFQ-1; Mon, 14 Jun 2021 06:54:00 -0400 X-MC-Unique: 05iMCcT2P-mE1vrM2jaWFQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D5FBC1932482; Mon, 14 Jun 2021 10:53:59 +0000 (UTC) Received: from localhost (unknown [10.33.36.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54A59705AD; Mon, 14 Jun 2021 10:53:59 +0000 (UTC) Date: Mon, 14 Jun 2021 11:53:58 +0100 To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Use reserved name for attribute [PR101055] Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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. Tested powerpc64le-linux. Committed to trunk. Backport to gcc-11 needed too. commit 917efba2dd4ff34336d0d3aa55285ae22503e4aa Author: Jonathan Wakely Date: Mon Jun 14 10:58:15 2021 libstdc++: Use reserved name for attribute [PR101055] 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. diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 3b771c50b25..2d562f8da77 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -73,7 +73,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool = __empty_not_final<_Head>::value> struct _Head_base; -#if __has_cpp_attribute(no_unique_address) +#if __has_cpp_attribute(__no_unique_address__) template struct _Head_base<_Idx, _Head, true> { diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc index c5c94ad7702..c38fc7d4d84 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2011/all_attributes.cc @@ -28,6 +28,7 @@ # define deprecated 1 # define visibility 1 #endif +#define no_unique_address 1 #define packed 1 #define pure 1 // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc index c8f036219ff..65d273db19c 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++2014/all_attributes.cc @@ -28,6 +28,7 @@ # define deprecated 1 # define visibility 1 #endif +#define no_unique_address 1 #define packed 1 #define pure 1 // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM. 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 c4e38d6423a..811b3fe3613 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 @@ -26,6 +26,7 @@ # define cold 1 # define visibility 1 #endif +#define no_unique_address 1 #define packed 1 #define pure 1 // glibc's sysdeps/unix/sysv/linux/arm/sys/ucontext.h uses this on ARM.