From patchwork Wed Dec 28 14:28:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathaniel Shead X-Patchwork-Id: 1719859 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.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=uz3kplHE; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nhv5s4FHhz23dc for ; Thu, 29 Dec 2022 01:28:45 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A5D093858281 for ; Wed, 28 Dec 2022 14:28:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A5D093858281 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1672237722; bh=NVJ/RORKCUV0X0vV7D6Ackm2BL/A93NTBAfiMlo6UJY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=uz3kplHE1AagUQ8FDC31vhPKTvj/il1xdFGLy/oG2f0viJwd75dPmtMYJGlOfhAEV 6Wej7YMD4Uj7gvdgdXHJgzpi14NoJkgRXBUjlFNteVWhtevsLrsnIsUwtZeU2p+4KD BI2WR7Ud4rgrlBmVJyCFRcDNafZYP+Hp1Qip/NJU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 5E0CF3858D33; Wed, 28 Dec 2022 14:28:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5E0CF3858D33 Received: by mail-pl1-x636.google.com with SMTP id s7so16191061plk.5; Wed, 28 Dec 2022 06:28:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NVJ/RORKCUV0X0vV7D6Ackm2BL/A93NTBAfiMlo6UJY=; b=p6gQ8+yD4sOp+J6Su3+XQjVCnqFvlJUqmlizlBhxWy5Z3T46cKHoHl4MBDNKbsFhnU v+yACa7UELqrDOZWWX7ht8wMI/9Buc3QPqszHRT/wRVQNjHtF9cOr2SSyG2QuIPDdG18 TQJtkw4ayMj3ej4vwYzTTMrZI3kIqsFfGrldSgb/2PerJkTOyRhz/rXojeunrLjoiJJu 5OplVqi92UL5B2KOvn7ZS2LkOniWnDoxItZKmEg3KjuDCN2YUE7fYatEQ7cfxL+D/IZB mypWGtPufCrumoT3DpIVFyM0jztflrPgCnol5Yt6PcP9zJ0pL9ireX32fh2T92KqCT70 udYA== X-Gm-Message-State: AFqh2kqa8wQEdQsZMtnGRbU/YAAs8EESWSh2WKILOiN8sAKnhN92bGj0 Qv0t9T7gh7MMe68EoExwDNnAKZgllMkARw== X-Google-Smtp-Source: AMrXdXtYV7Il317CCDtZL2io5J3glX0+16ehNdr14ouyO9hkt4wJCejvZ4eIown1mPgozLcWaDyDEA== X-Received: by 2002:a17:90b:3d0b:b0:219:5955:7570 with SMTP id pt11-20020a17090b3d0b00b0021959557570mr32126394pjb.46.1672237698489; Wed, 28 Dec 2022 06:28:18 -0800 (PST) Received: from Thaum.localdomain ([114.198.17.102]) by smtp.gmail.com with ESMTPSA id d15-20020a17090a3b0f00b002190eabb890sm5214508pjc.25.2022.12.28.06.28.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 06:28:17 -0800 (PST) Date: Thu, 29 Dec 2022 01:28:11 +1100 To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 1/2] libstdc++: Normalise _GLIBCXX20_DEPRECATED macro Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Nathaniel Shead via Gcc-patches From: Nathaniel Shead Reply-To: Nathaniel Shead Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" These two patches implement P1413 (deprecate std::aligned_storage and std::aligned_union) for C++23. Tested on x86_64-linux. -- >8 -- Updates _GLIBCXX20_DEPRECATED to be defined and behave the same as the versions for other standards (e.g. _GLIBCXX17_DEPRECATED). libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in (PREDEFINED): Update macros. * include/bits/c++config (_GLIBCXX20_DEPRECATED): Make consistent with other 'deprecated' macros. * include/std/type_traits (is_pod, is_pod_v): Use _GLIBCXX20_DEPRECATED_SUGGEST instead. Signed-off-by: Nathaniel Shead --- libstdc++-v3/doc/doxygen/user.cfg.in | 4 ++-- libstdc++-v3/include/bits/c++config | 6 +++--- libstdc++-v3/include/std/type_traits | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/doc/doxygen/user.cfg.in b/libstdc++-v3/doc/doxygen/user.cfg.in index 834ad9e4fd5..fc46e722529 100644 --- a/libstdc++-v3/doc/doxygen/user.cfg.in +++ b/libstdc++-v3/doc/doxygen/user.cfg.in @@ -2394,8 +2394,8 @@ PREDEFINED = __cplusplus=202002L \ "_GLIBCXX11_DEPRECATED_SUGGEST(E)= " \ "_GLIBCXX17_DEPRECATED= " \ "_GLIBCXX17_DEPRECATED_SUGGEST(E)= " \ - "_GLIBCXX20_DEPRECATED(E)= " \ - "_GLIBCXX20_DEPRECATED(E)= " \ + "_GLIBCXX20_DEPRECATED= " \ + "_GLIBCXX20_DEPRECATED_SUGGEST(E)= " \ _GLIBCXX17_INLINE=inline \ _GLIBCXX_CHRONO_INT64_T=int64_t \ _GLIBCXX_DEFAULT_ABI_TAG \ diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 50406066afe..d2b0cfa15ce 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -84,7 +84,7 @@ // _GLIBCXX14_DEPRECATED_SUGGEST( string-literal ) // _GLIBCXX17_DEPRECATED // _GLIBCXX17_DEPRECATED_SUGGEST( string-literal ) -// _GLIBCXX20_DEPRECATED( string-literal ) +// _GLIBCXX20_DEPRECATED // _GLIBCXX20_DEPRECATED_SUGGEST( string-literal ) #ifndef _GLIBCXX_USE_DEPRECATED # define _GLIBCXX_USE_DEPRECATED 1 @@ -124,10 +124,10 @@ #endif #if defined(__DEPRECATED) && (__cplusplus >= 202002L) -# define _GLIBCXX20_DEPRECATED(MSG) [[deprecated(MSG)]] +# define _GLIBCXX20_DEPRECATED [[__deprecated__]] # define _GLIBCXX20_DEPRECATED_SUGGEST(ALT) _GLIBCXX_DEPRECATED_SUGGEST(ALT) #else -# define _GLIBCXX20_DEPRECATED(MSG) +# define _GLIBCXX20_DEPRECATED # define _GLIBCXX20_DEPRECATED_SUGGEST(ALT) #endif diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 5dc9e1b2921..2f4d4bb8d4d 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -815,7 +815,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // Could use is_standard_layout && is_trivial instead of the builtin. template struct - _GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead") + _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout && is_trivial") is_pod : public integral_constant { @@ -3210,7 +3210,7 @@ template template inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp); template - _GLIBCXX20_DEPRECATED("use is_standard_layout_v && is_trivial_v instead") + _GLIBCXX20_DEPRECATED_SUGGEST("is_standard_layout_v && is_trivial_v") inline constexpr bool is_pod_v = __is_pod(_Tp); template _GLIBCXX17_DEPRECATED