gcc/libstdc++-v3/include/std
Jonathan Wakely d4fd8638be libstdc++: Fix ODR violations caused by <tr1/functional>
The placeholders for std::tr1::bind are defined in an anonymous
namespace, which means they have internal linkage. This will cause ODR
violations when used in function templates (such as std::tr1::bind) from
multiple translation units. Although probably harmless (every definition
will generate identical code, even if technically ill-formed) we can
avoid the ODR violations by reusing the std::placeholder objects as the
std::tr1::placeholder objects.

To make this work, the std::_Placeholder type needs to be defined for
C++98 mode, so that <tr1/functional> can use it. The members of the
std::placeholder namespace must not be defined by <functional> in C++98
mode, because "placeholders", "_1", "_2" etc. are not reserved names in
C++98. Instead they can be declared in <tr1/functional>, because those
names *are* reserved in that header. With the std::placeholders objects
declared, a simple using-directive suffices to redeclare them in
namespace std::tr1::placeholders. This means any use of the TR1
placeholders actually refers to the C++11 placeholders, which are
defined with external linkage and exported from the library, so don't
cause ODR violations.

libstdc++-v3/ChangeLog:

	* include/std/functional (std::_Placeholder): Define for C++98
	as well as later standards.
	* include/tr1/functional (std::placeholders::_1 etc): Declare
	for C++98.
	(tr1::_Placeholder): Replace with using-declaration for
	std::_Placeholder.
	(tr1::placeholders::_1 etc.): Replace with using-directive for
	std::placeholders.
2020-10-27 16:32:53 +00:00
..
algorithm
any
array
atomic
bit
bitset
charconv libstdc++: Add missing noexcept to std::from_chars declarations 2020-10-27 14:50:38 +00:00
chrono
codecvt
complex
concepts libstdc++: Fix typos in copyright notice 2020-10-15 19:20:21 +01:00
condition_variable libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00
coroutine libstdc++: Define noop coroutine details private and inline [PR 95917] 2020-10-20 11:37:48 +01:00
deque
execution
filesystem
forward_list
fstream
functional libstdc++: Fix ODR violations caused by <tr1/functional> 2020-10-27 16:32:53 +00:00
future libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00
iomanip
ios
iosfwd
iostream
istream
iterator
limits
list
locale
map
memory libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00
memory_resource libstdc++: Ensure std::forward_as_tuple is defined 2020-10-23 01:12:00 +01:00
mutex
numbers
numeric
optional
ostream
queue
random
ranges libstdc++: Apply proposed resolutions for LWG 3428, 3447 2020-10-23 09:03:25 -04:00
ratio
regex
scoped_allocator libstdc++: Reduce header dependencies in and on <memory> 2020-10-22 18:42:03 +01:00
set
shared_mutex libstdc++: Only include <condition_variable> in <shared_mutex> if needed 2020-10-22 18:49:38 +01:00
span
sstream libstdc++: Fix unspecified comparison to null pointer [PR 97415] 2020-10-14 18:55:14 +01:00
stack
stdexcept
stop_token
streambuf
string
string_view
system_error
thread
tuple libstdc++: Use reserved name for C++20 attribute 2020-10-19 18:07:21 +01:00
type_traits c++: Implement __is_nothrow_constructible and __is_nothrow_assignable 2020-10-26 15:36:24 +02:00
typeindex
unordered_map
unordered_set
utility
valarray
variant libstdc++: Fix visitor return type diagnostics [PR97449] 2020-10-17 23:10:40 +03:00
vector
version libstdc++: Only include <condition_variable> in <shared_mutex> if needed 2020-10-22 18:49:38 +01:00