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 ESMTP id B96213890001 for ; Thu, 1 Jul 2021 00:08:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B96213890001 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-182-eR181TdSMZO1gp0IbhvF0Q-1; Wed, 30 Jun 2021 20:08:43 -0400 X-MC-Unique: eR181TdSMZO1gp0IbhvF0Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62CBD1084F40; Thu, 1 Jul 2021 00:08:42 +0000 (UTC) Received: from localhost (unknown [10.33.36.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDFC85D6D3; Thu, 1 Jul 2021 00:08:40 +0000 (UTC) Date: Thu, 1 Jul 2021 01:08:40 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Suppress redundant definitions of static members in Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="7cz1Qvlz6wACEB60" Content-Disposition: inline X-Spam-Status: No, score=-14.0 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_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jul 2021 00:08:47 -0000 --7cz1Qvlz6wACEB60 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Since C++17 the static members of the random number engines are implicitly inline, so don't need definitions. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/random.tcc [__cpp_inline_variables]: Remove redundant definitions of static constexpr member variables. * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line number. Tested powerpc64le-linux. Committed to trunk. --7cz1Qvlz6wACEB60 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 996be6b670b9f85727a6ae98c8095ca9cfbc0f67 Author: Jonathan Wakely Date: Wed Jun 30 15:47:41 2021 libstdc++: Suppress redundant definitions of static members in Since C++17 the static members of the random number engines are implicitly inline, so don't need definitions. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/random.tcc [__cpp_inline_variables]: Remove redundant definitions of static constexpr member variables. * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line number. diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc index 8e2b702b0be..f28163ec03d 100644 --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -186,7 +186,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __is; } - +#if ! __cpp_inline_variables template::default_seed; +#endif template constexpr size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size; @@ -531,6 +532,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template constexpr _UIntType subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed; +#endif template void @@ -666,7 +668,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __is; } - +#if ! __cpp_inline_variables template constexpr size_t discard_block_engine<_RandomNumberEngine, __p, __r>::block_size; @@ -674,6 +676,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template constexpr size_t discard_block_engine<_RandomNumberEngine, __p, __r>::used_block; +#endif template typename discard_block_engine<_RandomNumberEngine, @@ -799,10 +802,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __sum; } - +#if ! __cpp_inline_variables template constexpr size_t shuffle_order_engine<_RandomNumberEngine, __k>::table_size; +#endif namespace __detail { diff --git a/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc b/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc index ba252ef34fe..ae03b5693c2 100644 --- a/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc +++ b/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc @@ -12,4 +12,4 @@ auto x = std::generate_canonical