From patchwork Mon Jan 8 16:13:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 186072 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp1156864dyq; Mon, 8 Jan 2024 09:20:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IHM7TRJFoiqGEHQGLsXbF/Co9wj8XDrinQBRwZQ5wUhT5hb/wSbWXq+QZYh/SiE4RJrmhnf X-Received: by 2002:a05:620a:24d3:b0:783:292d:75cb with SMTP id m19-20020a05620a24d300b00783292d75cbmr788837qkn.4.1704734400480; Mon, 08 Jan 2024 09:20:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704734400; cv=pass; d=google.com; s=arc-20160816; b=0SfwLNp+mAqqdphhN7R+iwQVPFmPYUZTDakSj4hzpr6cAMbc9/MTy3anm8Bivx1uE2 TClPeGuFBD26sQNOmISUVbGoFwHLgoBDKd4mT3U5FWsIEmNtMiXhn+1j1Hm6SqQW6SiI 1l1/MEB78d66TRpECc5IO6OiJjZ1rPvq8tmNhXrZoVe5K/Jqt91MJNJjL+563JYusS0+ 4Tga0fCI9y+uiEUHtSTGQF1pq9HlFkkDfNT99Y+qpldyb8BoUZcun2gxH7vF2f1PjHx8 ShPALvdmXbP/zhQD8IHe17CJSO7dkYwNcKpycoQX9FGGXR2W90Hhd45eQfyIGi9o+lpR xPNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=8APuA3jKNeXkWzGjTIc+xg/pucZoUul6ei5NeuDqeCc=; fh=sJ+2/4g29YdyXkoRrFZSpsL2zxijepB7X/1rB0LDDh8=; b=DCSFq6cwoDDY/ugTorNWcvkQY1ntV3oBkXesi+xKtWb6V2rj+cEaWL3r66aAaFooUT Sg+p4LXDk9VvjXah0JfwbLX9FNlBOarXFqBMulmT3sx2hi0wZlH9/lOVEYXRqzExBDUz 54P0xC/ooYhV76E7f36UeC5sO3xYtmDogCR0+3OukbmeWi6PEjA4+rL+/xm1u+0qEgA5 w1rGfYKG2nKgvY8u/n2M7kNL+8afC1CFGFb0PihoU5zXtAzOJ7EjEGbN98l3lse1I9oW ZDIw+D/qL/cVa4MTc/waMpgWAhwQ3OId59IiEspE3Db6Nu4kcNtmQKTd9KxVgBHvF0pn Stpw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iYULUYtB; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id c19-20020a05620a11b300b007831077244csi132440qkk.125.2024.01.08.09.20.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 09:20:00 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iYULUYtB; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8841C386075A for ; Mon, 8 Jan 2024 16:14:30 +0000 (GMT) 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.133.124]) by sourceware.org (Postfix) with ESMTPS id 6BF813858CDB for ; Mon, 8 Jan 2024 16:13:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6BF813858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6BF813858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704730419; cv=none; b=mVvtIkNUtHMyTGINfmnHMdLaKMqwwNaZOFAsH+ReDO2HZU0al8rKE0Tx2G8k+g692a7AHTOE5EPN0Cv9fJXPWsPUNjs/U7AOP9KDhgUGSL6IpeOZKRaFtFM8yc3/t/tKpk3wY1nnqyIJmBYqoe7pZhN0TwWf8/CZfSqfXkl1TYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704730419; c=relaxed/simple; bh=OLEmxXVg0mEuzEn9wCf9wLau666pGr/qLYECi3m94s8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=moVEnrCLSG/QWBFBGK6WRTVw+KdU0BbiuJ+wwGeTOJFwMhrNMMQu/FqnpGwtkoqMKo0X1Nz4KzAy5ZmTmz2kx8cePk4Hs/lBfguf8V5JyPTFYnhOwwLbC9Cj5Dp1bax+ZOOD31NZ02RjY92YuvaZBxwDeMCg5RmG5xfgA8kgwcM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704730418; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8APuA3jKNeXkWzGjTIc+xg/pucZoUul6ei5NeuDqeCc=; b=iYULUYtBo2UDdD6ls4W3RfE42RjpUXWzjCKafA5G1hb9sZwWOJoDl0i3CIXSwJEEB/5vxw 67iagNZlqxuhrAbw0LkWRI1G/w+gQoo7N6IBoiPj9XbN11pVqp5741+q6ZbYAKNwqa5vwx VAkn1SHGLSP3XKRw5UxdFlPfQsgKejY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-404-QVr1dB2rPdmQlvMhuywDZw-1; Mon, 08 Jan 2024 11:13:34 -0500 X-MC-Unique: QVr1dB2rPdmQlvMhuywDZw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 632B184A294; Mon, 8 Jan 2024 16:13:34 +0000 (UTC) Received: from localhost (unknown [10.42.28.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C0501121306; Mon, 8 Jan 2024 16:13:34 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Remove std::__unicode::__null_sentinel Date: Mon, 8 Jan 2024 16:13:05 +0000 Message-ID: <20240108161333.3785051-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.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_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787543578635576409 X-GMAIL-MSGID: 1787543578635576409 Tested x86_64-linux, pushed to trunk. -- >8 -- The name __null_sentinel is defined as a macro by newlib, so we can't use it as an identifier. That variable is not actually used by libstdc++, it was added because P2728R6 proposes std::uc::null_sentinel. Since we don't need it and it breaks bootstrap for newlib targets, just remove it. A null sentinel can still be used by constructing a _Null_sentinel_t object as needed, rather than having a named object of that type predefined. libstdc++-v3/ChangeLog: * include/bits/unicode.h (__null_sentinel): Remove. * testsuite/17_intro/names.cc: Add __null_sentinel. --- libstdc++-v3/include/bits/unicode.h | 2 -- libstdc++-v3/testsuite/17_intro/names.cc | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h index 66f8399fdfb..e49498a0531 100644 --- a/libstdc++-v3/include/bits/unicode.h +++ b/libstdc++-v3/include/bits/unicode.h @@ -83,8 +83,6 @@ namespace __unicode { return *__it == iter_value_t<_It>{}; } }; - inline constexpr _Null_sentinel_t __null_sentinel; - template _Sent = _Iter, typename _ErrorHandler = _Repl> diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc index 5e77e9f2ab0..53c5aff219d 100644 --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -140,6 +140,7 @@ // These clash with newlib so don't use them. # define __lockable cannot be used as an identifier +# define __null_sentinel cannot be used as an identifier # define __packed cannot be used as an identifier # define __unused cannot be used as an identifier # define __used cannot be used as an identifier