gcc/libstdc++-v3/include/std
Jonathan Wakely fe2651affa libstdc++: Fix iostream init for Clang on darwin [PR110432]
The __has_attribute(init_priority) check in <iostream> is true for Clang
on darwin, which means that user code including <iostream> thinks the
library will initialize the global streams. However, when libstdc++ is
built by GCC on darwin, the __has_attribute(init_priority) check is
false, which means that the library thinks that user code will do the
initialization when <iostream> is included. This means that the
initialization is never done.

Add an autoconf check so that the header and the library both make their
decision based on the static properties of GCC at build time, with a
consistent outcome.

As a belt and braces check, also do the initialization in <iostream> if
the compiler including that header doesn't support the attribute (even
if the library also containers the initialization). This might result in
redundant initialization done in <iostream>, but ensures the
initialization happens somewhere if there's any doubt about the
attribute working correctly due to missing linker support.

libstdc++-v3/ChangeLog:

	PR libstdc++/110432
	* acinclude.m4 (GLIBCXX_CHECK_INIT_PRIORITY): New.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Use GLIBCXX_CHECK_INIT_PRIORITY.
	* include/std/iostream: Use new autoconf macro as well as
	__has_attribute.
	* src/c++98/ios_base_init.h: Use new autoconf macro instead of
	__has_attribute.

Reviewed-by: Patrick Palka <ppalka@redhat.com>
2023-06-30 15:35:02 +01:00
..
algorithm Update copyright years. 2023-01-16 11:52:17 +01:00
any Update copyright years. 2023-01-16 11:52:17 +01:00
array libstdc++: Remove redundant code in std::to_array 2023-06-20 15:35:48 +01:00
atomic libstdc++: Stop using _GLIBCXX_USE_C99_STDINT_TR1 in <cstdint> 2023-05-16 09:59:19 +01:00
barrier Update copyright years. 2023-01-16 11:52:17 +01:00
bit libstdc++: Minor fixes to doxygen comments 2023-04-28 13:05:51 +01:00
bitset Update copyright years. 2023-01-16 11:52:17 +01:00
charconv Update copyright years. 2023-01-16 11:52:17 +01:00
chrono libstdc++: Fix chrono::hh_mm_ss::subseconds() [PR109772] 2023-05-11 21:15:22 +01:00
codecvt Update copyright years. 2023-01-16 11:52:17 +01:00
complex libstdc++: Stop using _GLIBCXX_USE_C99_MATH_TR1 in <cmath> 2023-05-31 21:01:16 +01:00
concepts Update copyright years. 2023-01-16 11:52:17 +01:00
condition_variable Update copyright years. 2023-01-16 11:52:17 +01:00
coroutine libstdc++: Add const to hash<coroutine_handle<P>>::operator() [PR109165] 2023-03-17 20:34:52 +00:00
deque Update copyright years. 2023-01-16 11:52:17 +01:00
execution Update copyright years. 2023-01-16 11:52:17 +01:00
expected libstdc++: Do not use std::expected::value() in monadic ops (LWG 3938) 2023-06-01 16:06:15 +01:00
filesystem libstdc++: Add @headerfile and @since to doxygen comments [PR40380] 2023-04-27 11:28:39 +01:00
format libstdc++: Fix std::format for pointers [PR110239] 2023-06-26 17:43:22 +01:00
forward_list Update copyright years. 2023-01-16 11:52:17 +01:00
fstream Update copyright years. 2023-01-16 11:52:17 +01:00
functional libstdc++: Reduce <functional> inclusion to <stl_algobase.h> 2023-06-01 06:26:48 +02:00
future Update copyright years. 2023-01-16 11:52:17 +01:00
iomanip libstdc++: Deprecate std::setfill for std::basic_istream [PR109922] 2023-05-31 13:17:44 +01:00
ios Update copyright years. 2023-01-16 11:52:17 +01:00
iosfwd Update copyright years. 2023-01-16 11:52:17 +01:00
iostream libstdc++: Fix iostream init for Clang on darwin [PR110432] 2023-06-30 15:35:02 +01:00
istream Update copyright years. 2023-01-16 11:52:17 +01:00
iterator Update copyright years. 2023-01-16 11:52:17 +01:00
latch Update copyright years. 2023-01-16 11:52:17 +01:00
limits libstdc++: Make std::numeric_limits<__float128> more portable [PR104772] 2023-06-06 16:29:22 +01:00
list Update copyright years. 2023-01-16 11:52:17 +01:00
locale Update copyright years. 2023-01-16 11:52:17 +01:00
map Update copyright years. 2023-01-16 11:52:17 +01:00
memory libstdc++: Harmonize <version> and other headers 2023-04-05 18:45:14 +02:00
memory_resource libstdc++: Improve doxygen docs for <memory_resource> 2023-04-27 11:28:39 +01:00
mutex libstdc++: Do not include <exception> in <mutex> 2023-05-31 13:17:46 +01:00
numbers libstdc++: Minor fixes to doxygen comments 2023-04-28 13:05:51 +01:00
numeric Update copyright years. 2023-01-16 11:52:17 +01:00
optional libstdc++: Use std::remove_cv_t in std::optional::transform [PR109340] 2023-03-30 00:06:25 +01:00
ostream Update copyright years. 2023-01-16 11:52:17 +01:00
queue Update copyright years. 2023-01-16 11:52:17 +01:00
random libstdc++: Remove <random> dependency on _GLIBCXX_USE_C99_STDINT_TR1 2023-05-12 17:46:28 +01:00
ranges libstdc++: Implement range_adaptor_closure from P2387R3 [PR108827] 2023-04-18 07:21:13 -04:00
ratio Update copyright years. 2023-01-16 11:52:17 +01:00
regex Update copyright years. 2023-01-16 11:52:17 +01:00
scoped_allocator libstdc++: Add missing noexcept to std::scoped_allocator_adaptor 2023-05-31 13:17:45 +01:00
semaphore Update copyright years. 2023-01-16 11:52:17 +01:00
set Update copyright years. 2023-01-16 11:52:17 +01:00
shared_mutex Update copyright years. 2023-01-16 11:52:17 +01:00
source_location Update copyright years. 2023-01-16 11:52:17 +01:00
span libstdc++: Implement P2278R4 "cbegin should always return a constant iterator" 2023-04-14 10:32:12 -04:00
spanstream libstdc++: Fix -Wsystem-headers warnings 2022-11-08 17:35:15 +00:00
sstream libstdc++: Define std::basic_stringbuf::view() for old std::string ABI 2023-02-02 16:57:27 +00:00
stack Update copyright years. 2023-01-16 11:52:17 +01:00
stacktrace libstdc++: Deliver names of C functions in <stacktrace> 2023-01-14 20:49:45 +00:00
stdexcept Update copyright years. 2023-01-16 11:52:17 +01:00
stdfloat Update copyright years. 2023-01-16 11:52:17 +01:00
stop_token libstdc++: Avoid -Wmaybe-uninitialized warning in std::stop_source [PR109339] 2023-03-31 14:20:52 +01:00
streambuf Update copyright years. 2023-01-16 11:52:17 +01:00
string Update copyright years. 2023-01-16 11:52:17 +01:00
string_view Update copyright years. 2023-01-16 11:52:17 +01:00
syncstream Update copyright years. 2023-01-16 11:52:17 +01:00
system_error Update copyright years. 2023-01-16 11:52:17 +01:00
thread Update copyright years. 2023-01-16 11:52:17 +01:00
tuple libstdc++: Fix uses of non-reserved names in headers 2023-02-16 10:24:45 +00:00
type_traits libstdc++: use using instead of typedef for type_traits 2023-06-09 13:30:39 -04:00
typeindex Update copyright years. 2023-01-16 11:52:17 +01:00
unordered_map Update copyright years. 2023-01-16 11:52:17 +01:00
unordered_set Update copyright years. 2023-01-16 11:52:17 +01:00
utility libstdc++: Define __cpp_lib_constexpr_algorithms in <utility> (LWG 3792) 2023-03-22 17:48:20 +00:00
valarray libstdc++: Reduce Doxygen output for PDF 2023-04-27 11:28:39 +01:00
variant libstdc++: Use emplace in std::variant::operator=(T&&) as per LWG 3585 2023-02-02 16:18:37 +00:00
vector Update copyright years. 2023-01-16 11:52:17 +01:00
version libstdc++: Implement range_adaptor_closure from P2387R3 [PR108827] 2023-04-18 07:21:13 -04:00