Files
gcc/libstdc++-v3
Tomasz Kamiński aef8797522 libstdc++: Fix constification in range_formatter::format [PR109162]
The _Rg is deduced to lvalue reference for the lvalue arguments,
and in such case __format::__maybe_const_range<_Rg, _CharT> is always _Rg
(adding const to reference does not change behavior).

Now we correctly check if _Range = remove_reference_t<_Rg> is const
formattable range, furthermore as range_formatter<T> can only format
ranges of values of type (possibly const) _Tp, we additional check if the
remove_cvref_t<range_reference_t<const _Range>> is _Tp.

The range_reference_t<R> and range_reference_t<const R> have different
types (modulo remove_cvref_t) for std::vector<bool> (::reference and bool)
or flat_map<T, U> (pair<const T&, U&> and pair<const T&, const U&>).

	PR libstdc++/109162

libstdc++-v3/ChangeLog:

	* include/std/format (range_formatter::format): Format const range,
	only if reference type is not changed.
	* testsuite/std/format/ranges/formatter.cc: New tests.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
2025-04-16 14:32:57 +02:00
..
2025-01-02 11:59:57 +01:00
2025-01-02 11:59:57 +01:00
2025-04-16 00:18:18 +00:00
2025-01-02 11:06:31 +01:00
2025-01-02 11:06:31 +01:00
2025-01-02 11:06:31 +01:00
2025-01-02 11:06:31 +01:00
2025-01-02 11:59:57 +01:00

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.