Information on known bugs, details on efforts to fix them, and fixed bugs are all available as part of the GCC bug tracking system, under the component “libstdc++”.
Everybody's got issues. Even the C++ Standard Library.
The Library Working Group, or LWG, is the ISO subcommittee responsible for making changes to the library. They periodically publish an Issues List containing problems and possible solutions. As they reach a consensus on proposed solutions, we often incorporate the solution.
Here are the issues which have resulted in code changes to the library. The links are to the full version of the Issues List. You can read the full version online at the ISO C++ Committee homepage.
If a DR is not listed here, we may simply not have gotten to
it yet; feel free to submit a patch. Search the
include
and
src
directories for appearances of
_GLIBCXX_RESOLVE_LIB_DEFECTS
for examples
of style. Note that we usually do not make changes to the
code until an issue has reached DR status.
This should be two overloaded functions rather than a single function.
Apparently extracting Boolean values was messed up...
If codecvt::do_in
returns noconv
there are
no changes to the values in [to, to_limit)
.
Re-opening a file stream does not clear the state flags.
Implement the proposed resolution.
Padding issues.
An instance of ios_base::failure
is constructed instead.
The return type is the previous state of synchronization.
These members functions are declared private
and are
thus inaccessible. Specifying the correct semantics of
"copying stream state" was deemed too complicated.
This DR made many widespread changes to basic_istream
and basic_ostream
all of which have been implemented.
Make the policy consistent with that of formatted input, unformatted input, and formatted output.
And they do now. An editing glitch in the last item in the list of [27.6.1.2.3]/7.
The text of the standard was gibberish. Typos gone rampant.
Change the first parameter to stateT&
and implement
the new effects paragraph.
Safety checks on the size of the string should test against
max_size()
rather than npos
.
The effect contain isspace(c,getloc())
which must be
replaced by isspace(c,is.getloc())
.
They behave as a formatted input function and as an unformatted
input function, respectively (except that getline
is
not required to set gcount
).
For associative containers where the value type is the same as
the key type, both iterator
and const_iterator
are constant iterators.
The binder1st
and binder2nd
didn't have an
operator()
taking a non-const parameter.
This was not a const member function. Note that the DR says to replace the function with a const one; we have instead provided an overloaded version with identical contents.
num_put::put()
was overloaded on the wrong types.
Same as 117, but for num_get::get()
.
These functions set failbit
on error now.
Make member erase
return iterator for set
, multiset
, map
, multimap
.
seekp
should only set the output stream, and
seekg
should only set the input stream.
op<<
with a const char*
was
calculating an incorrect number of characters to write.
Grow efficiently the internal array object.
Quite complex to summarize...
This function used to take its arguments as reference-to-const, now it copies them (pass by value).
Yes, it can, specifically if EOF is reached while skipping whitespace.
operator new(size_t, nothrow)
may become
unlinked to ordinary operator new
if ordinary
version replaced
The nothrow
forms of new and delete were
changed to call the throwing forms, handling any exception by
catching it and returning a null pointer.
If nothing is extracted into the string, op>>
now
sets failbit
(which can cause an exception, etc., etc.).
Both set
and multiset
were missing
overloaded find, lower_bound, upper_bound, and equal_range functions
for const instances.
For conversion from a floating-point type, str.precision()
is specified in the conversion specification.
Implement N1780, first check before then check after, insert as close to hint as possible.
The declaration of reverse_iterator
lists a default constructor.
However, no specification is given what this constructor should do.
Add a helper for forward_iterator/output_iterator, fix the existing one for input_iterator/output_iterator to not rely on Assignability.
Store a null character only if the character array has a non-zero size.
This nested typedef was originally not specified.
Make the copy constructor and copy-assignment operator declarations public in gslice_array, indirect_array, mask_array, slice_array; provide definitions.
The default ctor would build its members from copies of temporaries; now it simply uses their respective default ctors.
The bad_
* classes no longer have destructors (they
are trivial), since no description of them was ever given.
The typedefs it inherits from its base classes can't be used, since
(for example) basic_iostream<T>::traits_type
is ambiguous.
Similar to 118.
Add global functions with two template parameters. (NB: not added for now a templated assignment operator)
If (this == &rhs)
do nothing.
If (this == &x)
do nothing.
Basically, compare the input character to
is.widen(0)
and is.widen(1)
.
Do not specify what codecvt<wchar_t, char,
mbstate_t>::do_length
must return.
Change the format string to "%.0Lf".
Add const overloads of is_open
.
Add the real(T)
and imag(T)
members; in C++11 mode, also adjust the existing
real()
and imag()
members and
free functions.
Change it to return a const T&
.
Implement the proposed resolution.
Replace "new" with "::new".
Tweak the debug-mode checks in _Safe_iterator.
Have open
clear the error flags.
Change it to be an unformatted input function (i.e. construct a sentry and catch exceptions).
Implement Option 3, as per N1599.
Implement the resolution, beyond DR 169.
Add three overloads, taking fewer template arguments.
Implement the resolution, basically cast less.
Change istreambuf_iterator::reference
in C++11 mode.
Don't fail if the next pointer is null and newoff is zero.
Initialize cerr tied to cout and wcerr tied to wcout.
Add data()
to std::vector
and
at(const key_type&)
to std::map
.
Change lt
.
Fix the parameters.
Construct a linear_congruential
engine and seed with it.
Use &value.
In case of input_iterator/output_iterator rely on Assignability of input_iterator' value_type.
We were almost doing the right thing, just use std::move in adjacent_difference.
Add an auto_ptr<void> specialization.
Follow the straightforward proposed resolution.
In C++11 mode, remove the pow(float,int), etc., signatures.
flush()
not unformatted function
Change it to be a unformatted output function (i.e. construct a sentry and catch exceptions).
Change it to be a formatted output function (i.e. catch exceptions).
Add the missing modes to fopen_mode.
Implement the simple resolution.
Add the missing operations.
In C++11 mode add cbegin(size_type) and cend(size_type) to the unordered containers.
Add it, consistently with the discussion.
Make the member functions table and classic_table public.
Implement the straightforward resolution.
In C++11 mode, add at() and at() const.
Implement the int -> size_t replacements.
In C++11 mode, remove assign, add fill.
In C++11 mode, add std::proj.
Add the overload.
Update / add the signatures.
The traditional HP / SGI return type and value is blessed by the resolution of the DR.
Return the stream as its original type, not the base class.
Return the end of the filled range.
result_of
Correctly decay types in signature of std::async
.
is_destructible
underspecified
Handle non-object types.
Reorder enumerators.
Add additional overloads.
std::function
swaps
Add noexcept
to swap functions.
Respect propagation trait for move assignment.
Add noexcept to the comparison operators.
Fix signatures.
Use the referenceable type concept.
Change the reference
type.
Define and use is_always_equal
even for C++11.
unique_ptr
for array does not support cv qualification conversion of actual argument
Adjust constraints to allow safe conversions.
raw_storage_iterator
Add assignment operator taking an rvalue.
std::function
ambiguity
Constrain the constructor to only accept callable types.
common_type
trait produces reference types
Use decay
for the result type.
noexcept
specification in type_index
Add noexcept
error_category
default constructor
Declare a public constexpr constructor.
allocator_traits::max_size
missing noexcept
Add noexcept
.
vector<bool>
is missing emplace
and emplace_back
member functions
Add emplace
and emplace_back
member functions.
std::abs(0u)
is unclear
Move all declarations to a common header and remove the
generic abs
which accepted unsigned arguments.
is_*[copy/move]_[constructible/assignable]
unclear for non-referencable types
Use the referenceable type concept.
tuple_size
for const pair
request <tuple>
header
The tuple_size
and tuple_element
partial specializations are defined in <utility>
which
is included by <array>
.
std::addressof
should be constexpr
Use __builtin_addressof
and add
constexpr
to addressof
for C++17 and later.
match_results::reference
should be value_type&
, not const value_type&
Change typedef.
tuple_size
should always derive from integral_constant<size_t, N>
Update definitions of the partial specializations for const and volatile types.
Use perfect forwarding for right operand.
regex_match()/regex_search()
with match_results
should forbid temporary strings
Add deleted overloads for rvalue strings.
regex_iterator/regex_token_iterator
should forbid temporary regexes
Add deleted constructors.
Add overloads of insert
taking value_type&&
rvalues.
shared_ptr
's constructor from unique_ptr
should be constrained
Constrain the constructor to require convertibility.
shared_ptr
's get_deleter()
should use addressof()
Use addressof
.
std::function
needs more noexcept
Add noexcept
to the assignment and comparisons.
packaged_task(allocator_arg_t, const Allocator&, F&&)
should neither be constrained nor explicit
Remove explicit
from the constructor.
common_type
/iterator_traits
is missing in C++14
Make iterator_traits
empty if any of the
types is not present in the iterator.
Make common_type<>
empty.
unique_ptr
and shared_ptr
Create empty an shared_ptr
from an empty
unique_ptr
.
apply
does not work with member pointers
Use mem_fn
for member pointers.
seed_seq::size()
should be noexcept
Add noexcept
.
Define the typedefs.
call_once()
shouldn't DECAY_COPY()
Remove indirection through call wrapper that made copies
of arguments and forward arguments straight to std::invoke
.
raw_storage_iterator::base()
member
Add the base()
member function.
Make noexcept
specifications conditional.
Remove unused overloads.
std::polar
should require a non-negative rho
Add debug mode assertion.
common_type
is nearly impossible
to specialize correctly and regresses key functionality
Detect whether decay_t
changes either type
and use the decayed types if so.
allocator_traits::max_size()
default behavior is incorrect
Divide by the object type.
rethrow_if_nested()
is doubly unimplementable
Avoid using dynamic_cast
when it would be
ill-formed.
bind()
should be const
-overloaded
not cv-overloaded
Deprecate volatile-qualified operator()
for C++17, make it ill-formed for C++20.
operator>>(basic_istream&, CharT*)
makes it hard to avoid buffer overflows
Replace operator>>(basic_istream&, CharT*)
and other overloads writing through pointers.
priority_queue
taking allocators
should call make_heap
Call make_heap
.
Add static assertions to enforce the requirement.
basic_string(str, pos)
Add new constructor.
scoped_allocator_adaptor::construct()
Change internal helper for uses-allocator construction to always check using const lvalue allocators.
priority_queue
lacking comparator typedef
Define the value_compare
typedef.
std::abs(short)
,
std::abs(signed char)
and others should return
int
instead of double
in order to be
compatible with C++98 and C
Resolved by the changes for 2192.
tuple_size<const T>
specialization is not
SFINAE compatible and breaks decomposition declarations
Safely detect tuple_size<T>::value
and
only use it if valid.
std::function
and std::reference_wrapper
Remove special handling for reference_wrapper
arguments and store them directly as the target object.
shared_ptr
related
functions
Add noexcept.
shared_ptr
constructor requirements for a deleter
Use rvalues for deleters.
packaged_task
and type-erased allocators
For C++17 mode, remove the constructors taking an allocator argument.
weak_ptr::owner_before
Add noexcept.
shared_ptr
operations
Add additional constructor and cast overloads.
reference_wrapper<T>
conversion from T&&
Replaced the constructors with a constrained template, to prevent participation in overload resolution when not valid.
valarray
should only deduce from the valarray
Change scalar operands to be non-deduced context, so that they will allow conversions from other types to the value_type.
basic_string
CTAD ambiguity
Change constructors to constrained templates.
path::lexically_relative
is confused by trailing slashes
Implement the fix for trailing slashes.