From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050:0:465::101]) by sourceware.org (Postfix) with ESMTPS id 0726A3858C50; Sat, 29 Apr 2023 10:23:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0726A3858C50 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Q7ltq5Kvvz9snl; Sat, 29 Apr 2023 12:23:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1682763827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sl7l9qrxQz5w/tQ5Nl8ejoyOerUgpgoG9Gf7giartx4=; b=Yl4LYR782XuyYoZHFQTEEBBNvlcf2RkAWHB9TpP/bnNw1sPkhdqU4vbjdCjTz4b3P2KY4j DcrkoCKo0fkpgRTz29C04UFDoKtI3fyCLRWiq/jvnm2U6QwKOVyGjRA/thazAhwAbc9Mvy AYuMxkjNdvmZZCvpi8Uk7hjUYi0h50YXY7MnN9FD/7K+v9AG9UyysphfExlSDDx3GM/n0l 6+lHOTZqZWc3Wevus/TC3g3snNoMoBQERHdN8vuo9Y3MTOghUW4Ln1ADe40aoEWj1VJg89 fm/l4dbkDztInG2YeDkWos2UKxC2+7IGwnwmum7MWcSJrajX2TKdLod7fldq9Q== From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, =?UTF-8?q?Arsen=20Arsenovi=C4=87?= Subject: [PATCH 0/2] Unify and deduplicate FTM code Date: Sat, 29 Apr 2023 12:16:38 +0200 Message-Id: <20230429101640.1697750-1-arsen@aarsen.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Q7ltq5Kvvz9snl X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_INFOUSMEBIZ,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,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 List-Id: Greetings! This patch set replaces all code that involves defining feature test macros based on loosely put together conditionals in the standard library with a unified helper for specifying and requiring feature test macros, as well as updating most usage sites, many of which have been migrated to following a pattern similar, in structure, to: ... #define __glibcxx_want_foo #include ... namespace std { ... #ifdef __cpp_lib_foo template void foonicate(T&& t) { __builtin_foonicate_address(std::__addressof(t)); } #endif // __cpp_lib_foo ... } // namespace std In the future this should aid in preventing from being dishonest about what the implementation provides, as well as reducing the amount of finicky work it takes to update FTMs. Note that this patchset is not perfect. The usage sites of various feature test macros still include "wide" condition blocks that shadow over the blocks that check for FTMs, mostly in places where features with FTMs are the exception, rather than the norm. That said, using a pair of scripts[1][2], I've tested that the code emitted in bits/stdc++.h remains unchanged (save for a misdeclared __cpp_lib_constexpr_string in !HOSTED), as well as regression-tested --enable-languages=c,c++,lto on x86_64-pc-linux-gnu, and ran the libstdc++ testsuite with --target_board="unix{,-std=c++98,-std=gnu++11,-std=gnu++20, -D_GLIBCXX_USE_CXX11_ABI=0/-D_GLIBCXX_DEBUG,-D_GLIBCXX_DEBUG, -std=gnu++23}{-fno-freestanding,-ffreestanding}" (without the line breaks) to find no relevant failures. OK for trunk? Thanks in advance, have a lovely day. [1] https://git.sr.ht/~arsen/scripts/tree/master/item/difall.bash [2] https://git.sr.ht/~arsen/scripts/tree/master/item/vercmp.bash Arsen Arsenović (2): libstdc++: Implement more maintainable header libstdc++: Replace all manual FTM definitions and use libstdc++-v3/include/Makefile.am | 10 +- libstdc++-v3/include/Makefile.in | 10 +- libstdc++-v3/include/bits/algorithmfwd.h | 7 +- libstdc++-v3/include/bits/align.h | 8 +- libstdc++-v3/include/bits/alloc_traits.h | 11 +- libstdc++-v3/include/bits/allocator.h | 3 +- libstdc++-v3/include/bits/atomic_base.h | 14 +- libstdc++-v3/include/bits/atomic_wait.h | 10 +- libstdc++-v3/include/bits/basic_string.h | 24 +- libstdc++-v3/include/bits/char_traits.h | 11 +- libstdc++-v3/include/bits/chrono.h | 18 +- libstdc++-v3/include/bits/cow_string.h | 9 +- libstdc++-v3/include/bits/erase_if.h | 11 +- libstdc++-v3/include/bits/forward_list.h | 6 +- libstdc++-v3/include/bits/hashtable.h | 9 +- libstdc++-v3/include/bits/ios_base.h | 6 +- libstdc++-v3/include/bits/move.h | 8 +- .../include/bits/move_only_function.h | 9 +- libstdc++-v3/include/bits/node_handle.h | 8 +- libstdc++-v3/include/bits/ptr_traits.h | 15 +- libstdc++-v3/include/bits/range_access.h | 16 +- libstdc++-v3/include/bits/ranges_algo.h | 27 +- libstdc++-v3/include/bits/ranges_cmp.h | 14 +- libstdc++-v3/include/bits/shared_ptr.h | 10 +- libstdc++-v3/include/bits/shared_ptr_atomic.h | 6 +- libstdc++-v3/include/bits/shared_ptr_base.h | 17 +- libstdc++-v3/include/bits/specfun.h | 6 +- libstdc++-v3/include/bits/stl_algo.h | 20 +- libstdc++-v3/include/bits/stl_algobase.h | 13 +- libstdc++-v3/include/bits/stl_function.h | 28 +- libstdc++-v3/include/bits/stl_iterator.h | 21 +- libstdc++-v3/include/bits/stl_list.h | 6 +- libstdc++-v3/include/bits/stl_map.h | 6 +- libstdc++-v3/include/bits/stl_pair.h | 12 +- libstdc++-v3/include/bits/stl_queue.h | 9 +- libstdc++-v3/include/bits/stl_stack.h | 7 +- libstdc++-v3/include/bits/stl_tree.h | 7 +- libstdc++-v3/include/bits/stl_uninitialized.h | 9 +- libstdc++-v3/include/bits/stl_vector.h | 4 +- libstdc++-v3/include/bits/unique_ptr.h | 13 +- libstdc++-v3/include/bits/unordered_map.h | 8 +- .../include/bits/uses_allocator_args.h | 10 +- libstdc++-v3/include/bits/utility.h | 21 +- libstdc++-v3/include/bits/version.def | 1591 ++++++++++++++ libstdc++-v3/include/bits/version.h | 1937 +++++++++++++++++ libstdc++-v3/include/bits/version.tpl | 209 ++ .../include/c_compatibility/stdatomic.h | 9 +- libstdc++-v3/include/c_global/cmath | 18 +- libstdc++-v3/include/c_global/cstddef | 9 +- libstdc++-v3/include/std/algorithm | 10 +- libstdc++-v3/include/std/any | 9 +- libstdc++-v3/include/std/array | 9 +- libstdc++-v3/include/std/atomic | 67 +- libstdc++-v3/include/std/barrier | 11 +- libstdc++-v3/include/std/bit | 30 +- libstdc++-v3/include/std/bitset | 7 +- libstdc++-v3/include/std/charconv | 11 +- libstdc++-v3/include/std/complex | 11 +- libstdc++-v3/include/std/concepts | 10 +- libstdc++-v3/include/std/coroutine | 20 +- libstdc++-v3/include/std/deque | 9 +- libstdc++-v3/include/std/execution | 10 +- libstdc++-v3/include/std/expected | 8 +- libstdc++-v3/include/std/filesystem | 9 +- libstdc++-v3/include/std/format | 19 +- libstdc++-v3/include/std/forward_list | 10 +- libstdc++-v3/include/std/functional | 39 +- libstdc++-v3/include/std/iomanip | 9 +- libstdc++-v3/include/std/iterator | 5 +- libstdc++-v3/include/std/latch | 10 +- libstdc++-v3/include/std/list | 10 +- libstdc++-v3/include/std/memory | 15 +- libstdc++-v3/include/std/memory_resource | 20 +- libstdc++-v3/include/std/mutex | 8 +- libstdc++-v3/include/std/numbers | 8 +- libstdc++-v3/include/std/numeric | 35 +- libstdc++-v3/include/std/optional | 15 +- libstdc++-v3/include/std/ranges | 60 +- libstdc++-v3/include/std/semaphore | 9 +- libstdc++-v3/include/std/shared_mutex | 12 +- libstdc++-v3/include/std/source_location | 9 +- libstdc++-v3/include/std/span | 11 +- libstdc++-v3/include/std/spanstream | 11 +- libstdc++-v3/include/std/stacktrace | 10 +- libstdc++-v3/include/std/stop_token | 5 +- libstdc++-v3/include/std/string | 9 +- libstdc++-v3/include/std/string_view | 23 +- libstdc++-v3/include/std/syncstream | 17 +- libstdc++-v3/include/std/thread | 3 + libstdc++-v3/include/std/tuple | 25 +- libstdc++-v3/include/std/type_traits | 141 +- libstdc++-v3/include/std/utility | 38 +- libstdc++-v3/include/std/variant | 13 +- libstdc++-v3/include/std/vector | 9 +- libstdc++-v3/include/std/version | 350 +-- libstdc++-v3/libsupc++/compare | 11 +- libstdc++-v3/libsupc++/exception | 6 +- libstdc++-v3/libsupc++/new | 20 +- libstdc++-v3/libsupc++/typeinfo | 7 +- .../array/tuple_interface/get_neg.cc | 6 +- 100 files changed, 4445 insertions(+), 1064 deletions(-) create mode 100644 libstdc++-v3/include/bits/version.def create mode 100644 libstdc++-v3/include/bits/version.h create mode 100644 libstdc++-v3/include/bits/version.tpl -- 2.40.1