From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 EE15B3858291 for ; Wed, 9 Aug 2023 14:21:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE15B3858291 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691590910; 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=+MTXWZJDw6XZvd7ytJ/T7C91o+1V+NIJsGYuy3aC2ys=; b=aHZRsoHnHYLhnh2+q9gSuTNSPJexGtG3N9/onqN7uSf817kScvFNM4Q54hHOEZAfc9WARo vffWLboNYS7neZv9cX+h/3wv7UmYy3pK/N4j5dVfphBGVft58miD4QPzTVHO3Tkuz7tthD FdcApvC7k/C7xqxzYI4QLlQDUxmm3GE= 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-86-wW7ju4ldNByETExdZ-v54A-1; Wed, 09 Aug 2023 10:21:47 -0400 X-MC-Unique: wW7ju4ldNByETExdZ-v54A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4556D85CBE5; Wed, 9 Aug 2023 14:21:47 +0000 (UTC) Received: from localhost (unknown [10.42.28.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 02BF12026D4B; Wed, 9 Aug 2023 14:21:46 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Minor fixes for some warnings in Date: Wed, 9 Aug 2023 15:21:22 +0100 Message-ID: <20230809142146.1014795-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/std/format: Fix some warnings. (__format::__write(Ctx&, basic_string_view)): Remove unused function template. --- libstdc++-v3/include/std/format | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/libstdc++-v3/include/std/format b/libstdc++-v3/include/std/format index f68308e7210..96eb4cd742e 100644 --- a/libstdc++-v3/include/std/format +++ b/libstdc++-v3/include/std/format @@ -79,7 +79,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __format { // Type-erased character sink. - template struct _Sink; + template class _Sink; // Output iterator that writes to a type-erase character sink. template class _Sink_iter; @@ -280,7 +280,6 @@ namespace __format } else { - unsigned short __val = 0; constexpr int __n = 32; char __buf[__n]{}; for (int __i = 0; __i < __n && (__first + __i) != __last; ++__i) @@ -1468,6 +1467,8 @@ namespace __format if (__use_prec) __fmt = chars_format::general; break; + default: + __builtin_unreachable(); } // Write value into buffer using std::to_chars. @@ -2083,7 +2084,11 @@ namespace __format // _GLIBCXX_RESOLVE_LIB_DEFECTS // P2510R3 Formatting pointers -#define _GLIBCXX_P2518R3 (__cplusplus > 202302L || ! defined __STRICT_ANSI__) +#if __cplusplus > 202302L || ! defined __STRICT_ANSI__ +#define _GLIBCXX_P2518R3 1 +#else +#define _GLIBCXX_P2518R3 0 +#endif #if _GLIBCXX_P2518R3 __first = __spec._M_parse_zero_fill(__first, __last); @@ -2641,7 +2646,7 @@ namespace __format _Arg_none, _Arg_bool, _Arg_c, _Arg_i, _Arg_u, _Arg_ll, _Arg_ull, _Arg_flt, _Arg_dbl, _Arg_ldbl, _Arg_str, _Arg_sv, _Arg_ptr, _Arg_handle, _Arg_i128, _Arg_u128, - _Arg_bf16, _Arg_f16, _Arg_f32, _Arg_f64, + _Arg_bf16, _Arg_f16, _Arg_f32, _Arg_f64, // These are unused. #ifdef _GLIBCXX_LONG_DOUBLE_ALT128_COMPAT _Arg_next_value_, _Arg_f128 = _Arg_ldbl, @@ -3106,14 +3111,16 @@ namespace __format case _Arg_u128: return std::forward<_Visitor>(__vis)(_M_val._M_u128); #endif - // TODO _Arg_f16 etc. #if _GLIBCXX_FORMAT_F128 == 2 case _Arg_f128: return std::forward<_Visitor>(__vis)(_M_val._M_f128); #endif + + default: + // _Arg_f16 etc. + __builtin_unreachable(); } - __builtin_unreachable(); } }; @@ -3422,15 +3429,6 @@ namespace __format /// @cond undocumented namespace __format { - template - [[__gnu__::__always_inline__]] - inline void - __write(_Ctx& __ctx, basic_string_view<_CharT> __str) - requires requires { { __ctx.out() } -> output_iterator; } - { - __ctx.advance_to(__format::__write(__ctx.out())); - } - // Abstract base class defining an interface for scanning format strings. // Scan the characters in a format string, dividing it up into strings of // ordinary characters, escape sequences, and replacement fields. -- 2.41.0