From patchwork Fri May 12 16:48:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 93281 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp5251030vqo; Fri, 12 May 2023 09:50:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5MbwB57p0yoHkqKJ3l8gUseVnjZL5jHOIarcMHEUYJ1FUtyWIb00uD+GvECrl0MeP88m0D X-Received: by 2002:a05:6402:4c4:b0:50d:9b59:4327 with SMTP id n4-20020a05640204c400b0050d9b594327mr16206453edw.29.1683910243315; Fri, 12 May 2023 09:50:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683910243; cv=none; d=google.com; s=arc-20160816; b=r17zCqTx2WYl+rfmIHKjZ9lf2MxYYOqEi3wNEYC0H0UirTk7twTtBdCAgzqERqGwIM vlE0qGZHPVjrsIu9HwxyNEYoc3nT/1RBnUtYce/FfsmTMbd6Q7bdDBdG9BVTggk/7dwj ZsnbMASkzv6IZyUzIOZCBQHngjUf8z1lwlL/iMjtduwfQWPObHM1MdfnpfNfEsc1RIT2 d1aEI7o6nr/8rT6M5Rq8Cmnxg/YzwG7QE1j2JCMcm/59hvsRxIuXFOvpBPK5w0gok+bB WPb6dUxH9XvFaVilo4JiGIt0OY8PNWqQE+vv6UdN7UU7PUiXum5YhOoXFsb71rrxc7ql /1jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=rmSnitcKBoGpmMNo1HbbJ/DWonORozCKdjcyugIjo3A=; b=mPtiSK2sfHXoCBPfgGyenqHQELDQHrfUFvRvXpAygYCYxTY1mT4Cj1UidQdQ8drHIn 0skbUxla6c3ljj6OOJg6cIm43CyKnPyrCQvU6TGSf6uOjI52/Y+j5AWw6PZXlqZX6gX/ +BM+Flh/ivSU4SDwzTb6VUQp8KLllspL0mFhsA3Al85/ljEI0CIdx3kB39fplBAYkhCq vlE65t4mWxssN0ngQ+n8YmewTghOxH0xydrS3t2/1K1g1/SX02GXaHCpg3tGsq+x0O2w H6OlydSiCuwR7TJ9F/mnGIXjTHhDVpOCPYjyCyP4usXMywmtDZq5BxsO0vbRJkGKnbFV U9cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="U/FpNTvI"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id g22-20020a50ee16000000b0050bc42fdf9bsi7141556eds.132.2023.05.12.09.50.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 09:50:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="U/FpNTvI"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB7C63858426 for ; Fri, 12 May 2023 16:49:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB7C63858426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683910178; bh=rmSnitcKBoGpmMNo1HbbJ/DWonORozCKdjcyugIjo3A=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=U/FpNTvIZLzgT6zOX7bSAzdbbV2Spl0KNvPvAykvz2xGwYDPcB1iQaMbuzlC2lF/u qBOVoL4J4wnZzTETBI70Rs3Vl1cwypUZkDlBNltc/f72hDO1qfR3IjWv83BBYjBzfU 4nCCI+v2tdPh5jmyGBFiL6swyQXLc+AFehAfNT84= 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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 42F373854148 for ; Fri, 12 May 2023 16:48:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 42F373854148 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115-sFqFuTfCPbinkzt8cEkmAQ-1; Fri, 12 May 2023 12:48:50 -0400 X-MC-Unique: sFqFuTfCPbinkzt8cEkmAQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2104F88CC43; Fri, 12 May 2023 16:48:50 +0000 (UTC) Received: from localhost (unknown [10.42.28.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id E07A740C2076; Fri, 12 May 2023 16:48:49 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Remove redundant dependencies on _GLIBCXX_USE_C99_STDINT_TR1 Date: Fri, 12 May 2023 17:48:49 +0100 Message-Id: <20230512164849.1303313-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765707866892366305?= X-GMAIL-MSGID: =?utf-8?q?1765707866892366305?= Tested powerpc64le-linux. Pushed to trunk. -- >8 -- We never need to use std::make_unsigned in std::char_traits and std::char_traits because guarantees to provide the types we need, since r9-2028-g8ba7f29e3dd064. Similarly, experimental::source_location can just assume uint_least32_t is defined by . libstdc++-v3/ChangeLog: * include/bits/char_traits.h (char_traits): Do not depend on _GLIBCXX_USE_C99_STDINT_TR1. (char_traits): Likewise. * include/experimental/source_location: Likewise. --- libstdc++-v3/include/bits/char_traits.h | 8 ++------ libstdc++-v3/include/experimental/source_location | 6 ------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h index 68ed827f982..0928137854b 100644 --- a/libstdc++-v3/include/bits/char_traits.h +++ b/libstdc++-v3/include/bits/char_traits.h @@ -762,10 +762,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef char16_t char_type; #ifdef __UINT_LEAST16_TYPE__ typedef __UINT_LEAST16_TYPE__ int_type; -#elif defined _GLIBCXX_USE_C99_STDINT_TR1 - typedef uint_least16_t int_type; #else - typedef make_unsigned::type int_type; + typedef uint_least16_t int_type; #endif #if _GLIBCXX_HOSTED typedef streamoff off_type; @@ -891,10 +889,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef char32_t char_type; #ifdef __UINT_LEAST32_TYPE__ typedef __UINT_LEAST32_TYPE__ int_type; -#elif defined _GLIBCXX_USE_C99_STDINT_TR1 - typedef uint_least32_t int_type; #else - typedef make_unsigned::type int_type; + typedef uint_least32_t int_type; #endif #if _GLIBCXX_HOSTED typedef streamoff off_type; diff --git a/libstdc++-v3/include/experimental/source_location b/libstdc++-v3/include/experimental/source_location index 1dfce7343c6..ee94a36cc43 100644 --- a/libstdc++-v3/include/experimental/source_location +++ b/libstdc++-v3/include/experimental/source_location @@ -44,12 +44,6 @@ inline namespace fundamentals_v2 { struct source_location { -#ifndef _GLIBCXX_USE_C99_STDINT_TR1 - private: - using uint_least32_t = unsigned; - public: -#endif - // 14.1.2, source_location creation static constexpr source_location current(const char* __file = __builtin_FILE(),