<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gcc.git/libstdc++-v3/python, branch devel/rust/master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/'/>
<entry>
<title>libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318]</title>
<updated>2024-01-17T11:49:11+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2024-01-15T15:42:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=df0a668b784556fe4317317d58961652d93d53de'/>
<id>df0a668b784556fe4317317d58961652d93d53de</id>
<content type='text'>
This is another C++26 change, approved in Varna 2023. We require a new
static array of data that is extracted from the IANA Character Sets
database. A new Python script to generate a header from the IANA CSV
file is added.

The text_encoding class is basically just a pointer to an {ID,name} pair
in the static array. The aliases view is also just the same pointer (or
empty), and the view's iterator moves forwards and backwards in the
array while the array elements have the same ID (or to one element
further, for a past-the-end iterator).

Because those iterators refer to a global array that never goes out of
scope, there's no reason they should every produce undefined behaviour
or indeterminate values.  They should either have well-defined
behaviour, or abort. The overhead of ensuring those properties is pretty
low, so seems worth it.

This means that an aliases_view iterator should never be able to access
out-of-bounds. A non-value-initialized iterator always points to an
element of the static array even when not dereferenceable (the array has
unreachable entries at the start and end, which means that even a
past-the-end iterator for the last encoding in the array still points to
valid memory).  Dereferencing an iterator can always return a valid
array element, or "" for a non-dereferenceable iterator (but doing so
will abort when assertions are enabled).  In the language being proposed
for C++26, dereferencing an invalid iterator erroneously returns "".
Attempting to increment/decrement past the last/first element in the
view is erroneously a no-op, so aborts when assertions are enabled, and
doesn't change value otherwise.

Similarly, constructing a std::text_encoding with an invalid id (one
that doesn't have the value of an enumerator) erroneously behaves the
same as constructing with id::unknown, or aborts with assertions
enabled.

libstdc++-v3/ChangeLog:

	PR libstdc++/113318
	* acinclude.m4 (GLIBCXX_CONFIGURE): Add c++26 directory.
	(GLIBCXX_CHECK_TEXT_ENCODING): Define.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Use GLIBCXX_CHECK_TEXT_ENCODING.
	* include/Makefile.am: Add new headers.
	* include/Makefile.in: Regenerate.
	* include/bits/locale_classes.h (locale::encoding): Declare new
	member function.
	* include/bits/unicode.h (__charset_alias_match): New function.
	* include/bits/text_encoding-data.h: New file.
	* include/bits/version.def (text_encoding): Define.
	* include/bits/version.h: Regenerate.
	* include/std/text_encoding: New file.
	* src/Makefile.am: Add new subdirectory.
	* src/Makefile.in: Regenerate.
	* src/c++26/Makefile.am: New file.
	* src/c++26/Makefile.in: New file.
	* src/c++26/text_encoding.cc: New file.
	* src/experimental/Makefile.am: Include c++26 convenience
	library.
	* src/experimental/Makefile.in: Regenerate.
	* python/libstdcxx/v6/printers.py (StdTextEncodingPrinter): New
	printer.
	* scripts/gen_text_encoding_data.py: New file.
	* testsuite/22_locale/locale/encoding.cc: New test.
	* testsuite/ext/unicode/charset_alias_match.cc: New test.
	* testsuite/std/text_encoding/cons.cc: New test.
	* testsuite/std/text_encoding/members.cc: New test.
	* testsuite/std/text_encoding/requirements.cc: New test.

Reviewed-by: Ulrich Drepper &lt;drepper.fsp@gmail.com&gt;
Reviewed-by: Patrick Palka &lt;ppalka@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is another C++26 change, approved in Varna 2023. We require a new
static array of data that is extracted from the IANA Character Sets
database. A new Python script to generate a header from the IANA CSV
file is added.

The text_encoding class is basically just a pointer to an {ID,name} pair
in the static array. The aliases view is also just the same pointer (or
empty), and the view's iterator moves forwards and backwards in the
array while the array elements have the same ID (or to one element
further, for a past-the-end iterator).

Because those iterators refer to a global array that never goes out of
scope, there's no reason they should every produce undefined behaviour
or indeterminate values.  They should either have well-defined
behaviour, or abort. The overhead of ensuring those properties is pretty
low, so seems worth it.

This means that an aliases_view iterator should never be able to access
out-of-bounds. A non-value-initialized iterator always points to an
element of the static array even when not dereferenceable (the array has
unreachable entries at the start and end, which means that even a
past-the-end iterator for the last encoding in the array still points to
valid memory).  Dereferencing an iterator can always return a valid
array element, or "" for a non-dereferenceable iterator (but doing so
will abort when assertions are enabled).  In the language being proposed
for C++26, dereferencing an invalid iterator erroneously returns "".
Attempting to increment/decrement past the last/first element in the
view is erroneously a no-op, so aborts when assertions are enabled, and
doesn't change value otherwise.

Similarly, constructing a std::text_encoding with an invalid id (one
that doesn't have the value of an enumerator) erroneously behaves the
same as constructing with id::unknown, or aborts with assertions
enabled.

libstdc++-v3/ChangeLog:

	PR libstdc++/113318
	* acinclude.m4 (GLIBCXX_CONFIGURE): Add c++26 directory.
	(GLIBCXX_CHECK_TEXT_ENCODING): Define.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Use GLIBCXX_CHECK_TEXT_ENCODING.
	* include/Makefile.am: Add new headers.
	* include/Makefile.in: Regenerate.
	* include/bits/locale_classes.h (locale::encoding): Declare new
	member function.
	* include/bits/unicode.h (__charset_alias_match): New function.
	* include/bits/text_encoding-data.h: New file.
	* include/bits/version.def (text_encoding): Define.
	* include/bits/version.h: Regenerate.
	* include/std/text_encoding: New file.
	* src/Makefile.am: Add new subdirectory.
	* src/Makefile.in: Regenerate.
	* src/c++26/Makefile.am: New file.
	* src/c++26/Makefile.in: New file.
	* src/c++26/text_encoding.cc: New file.
	* src/experimental/Makefile.am: Include c++26 convenience
	library.
	* src/experimental/Makefile.in: Regenerate.
	* python/libstdcxx/v6/printers.py (StdTextEncodingPrinter): New
	printer.
	* scripts/gen_text_encoding_data.py: New file.
	* testsuite/22_locale/locale/encoding.cc: New test.
	* testsuite/ext/unicode/charset_alias_match.cc: New test.
	* testsuite/std/text_encoding/cons.cc: New test.
	* testsuite/std/text_encoding/members.cc: New test.
	* testsuite/std/text_encoding/requirements.cc: New test.

Reviewed-by: Ulrich Drepper &lt;drepper.fsp@gmail.com&gt;
Reviewed-by: Patrick Palka &lt;ppalka@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Add GDB printer for std::integral_constant</title>
<updated>2024-01-11T17:35:57+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2024-01-10T10:53:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=cd2022f39297198adad0e284f8780cb3d83d0f85'/>
<id>cd2022f39297198adad0e284f8780cb3d83d0f85</id>
<content type='text'>
libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (StdIntegralConstantPrinter):
	Add printer for std::integral_constant.
	* testsuite/libstdc++-prettyprinters/cxx11.cc: Test it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (StdIntegralConstantPrinter):
	Add printer for std::integral_constant.
	* testsuite/libstdc++-prettyprinters/cxx11.cc: Test it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update copyright years.</title>
<updated>2024-01-03T11:19:35+00:00</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2024-01-03T11:19:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=a945c346f57ba40fc80c14ac59be0d43624e559d'/>
<id>a945c346f57ba40fc80c14ac59be0d43624e559d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Fix std::deque::operator[] Xmethod [PR112491]</title>
<updated>2023-11-15T11:16:49+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2023-11-14T15:08:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=452476db0c705caeac8712d560fc16ced0ca5226'/>
<id>452476db0c705caeac8712d560fc16ced0ca5226</id>
<content type='text'>
The Xmethod for std::deque::operator[] has the same bug that I recently
fixed for the std::deque::size() Xmethod. The first node might have
unused capacity at the start, which needs to be accounted for when
indexing into the deque.

libstdc++-v3/ChangeLog:

	PR libstdc++/112491
	* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.index):
	Correctly handle unused capacity at the start of the first node.
	* testsuite/libstdc++-xmethods/deque.cc: Check index operator
	when elements have been removed from the front.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Xmethod for std::deque::operator[] has the same bug that I recently
fixed for the std::deque::size() Xmethod. The first node might have
unused capacity at the start, which needs to be accounted for when
indexing into the deque.

libstdc++-v3/ChangeLog:

	PR libstdc++/112491
	* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.index):
	Correctly handle unused capacity at the start of the first node.
	* testsuite/libstdc++-xmethods/deque.cc: Check index operator
	when elements have been removed from the front.
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Fix std::deque::size() Xmethod [PR112491]</title>
<updated>2023-11-14T15:55:03+00:00</updated>
<author>
<name>Jonathan Wakely</name>
<email>jwakely@redhat.com</email>
</author>
<published>2023-11-14T15:08:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=4db820928065eccbeb725406450d826186582b9f'/>
<id>4db820928065eccbeb725406450d826186582b9f</id>
<content type='text'>
The Xmethod for std::deque::size() assumed that the first element would
be at the start of the first node. That's only true if elements are only
added at the back. If an element is inserted at the front, or removed
from the front (or anywhere before the middle) then the first node will
not be completely populated, and the Xmethod will give the wrong result.

libstdc++-v3/ChangeLog:

	PR libstdc++/112491
	* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.size): Fix
	calculation to use _M_start._M_cur.
	* testsuite/libstdc++-xmethods/deque.cc: Check failing cases.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Xmethod for std::deque::size() assumed that the first element would
be at the start of the first node. That's only true if elements are only
added at the back. If an element is inserted at the front, or removed
from the front (or anywhere before the middle) then the first node will
not be completely populated, and the Xmethod will give the wrong result.

libstdc++-v3/ChangeLog:

	PR libstdc++/112491
	* python/libstdcxx/v6/xmethods.py (DequeWorkerBase.size): Fix
	calculation to use _M_start._M_cur.
	* testsuite/libstdc++-xmethods/deque.cc: Check failing cases.
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Correctly call _string_types function</title>
<updated>2023-10-04T16:38:33+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tromey@adacore.com</email>
</author>
<published>2023-10-04T14:59:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=4bf77db70e2521dc89f9d7f51c7ae6e58a94b4f9'/>
<id>4bf77db70e2521dc89f9d7f51c7ae6e58a94b4f9</id>
<content type='text'>
flake8 points out that the new call to _string_types from
StdExpAnyPrinter.__init__ is not correct -- it needs to be qualified.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py
	(StdExpAnyPrinter.__init__): Qualify call to
	_string_types.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
flake8 points out that the new call to _string_types from
StdExpAnyPrinter.__init__ is not correct -- it needs to be qualified.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py
	(StdExpAnyPrinter.__init__): Qualify call to
	_string_types.
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: _versioned_namespace is always non-None</title>
<updated>2023-10-04T14:23:30+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tromey@adacore.com</email>
</author>
<published>2023-10-03T17:14:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=d342c9de6a1534cbce324bcc3c7c0898ff74d386'/>
<id>d342c9de6a1534cbce324bcc3c7c0898ff74d386</id>
<content type='text'>
Some code in the pretty-printers seems to assume that the
_versioned_namespace global might be None (or the empty string).
However, doesn't occur, as the variable is never reassigned.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py: Assume that
	_versioned_namespace is non-None.
	* python/libstdcxx/v6/xmethods.py (is_specialization_of):
	Assume that _versioned_namespace is non-None.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some code in the pretty-printers seems to assume that the
_versioned_namespace global might be None (or the empty string).
However, doesn't occur, as the variable is never reassigned.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py: Assume that
	_versioned_namespace is non-None.
	* python/libstdcxx/v6/xmethods.py (is_specialization_of):
	Assume that _versioned_namespace is non-None.
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Define _versioned_namespace in xmethods.py</title>
<updated>2023-10-04T14:23:30+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tromey@adacore.com</email>
</author>
<published>2023-10-03T17:08:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=83ec6e80ff0d56342fc066c2ef649036c0983529'/>
<id>83ec6e80ff0d56342fc066c2ef649036c0983529</id>
<content type='text'>
flake8 pointed out that is_specialization_of in xmethods.py looks at a
global that wasn't added to the file.  This patch correct the
oversight.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/xmethods.py (_versioned_namespace):
	Define.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
flake8 pointed out that is_specialization_of in xmethods.py looks at a
global that wasn't added to the file.  This patch correct the
oversight.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/xmethods.py (_versioned_namespace):
	Define.
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Use Python "not in" operator</title>
<updated>2023-09-28T20:56:09+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tromey@adacore.com</email>
</author>
<published>2023-09-27T15:26:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=202810947ca793b17653658e584008fb151e0937'/>
<id>202810947ca793b17653658e584008fb151e0937</id>
<content type='text'>
flake8 warns about code like

    not something in "whatever"

Ordinarily in Python this should be written as:

    something not in "whatever"

This patch makes this change.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (Printer.add_version)
	(add_one_template_type_printer)
	(FilteringTypePrinter.add_one_type_printer): Use Python
	"not in" operator.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
flake8 warns about code like

    not something in "whatever"

Ordinarily in Python this should be written as:

    something not in "whatever"

This patch makes this change.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (Printer.add_version)
	(add_one_template_type_printer)
	(FilteringTypePrinter.add_one_type_printer): Use Python
	"not in" operator.
</pre>
</div>
</content>
</entry>
<entry>
<title>libstdc++: Remove std_ratio_t_tuple</title>
<updated>2023-09-28T20:56:05+00:00</updated>
<author>
<name>Tom Tromey</name>
<email>tromey@adacore.com</email>
</author>
<published>2023-09-26T20:04:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/gcc.git/commit/?id=860b284e3eea49e5bd49e6fe07c66e53faebb893'/>
<id>860b284e3eea49e5bd49e6fe07c66e53faebb893</id>
<content type='text'>
This removes the std_ratio_t_tuple function from the Python
pretty-printer code.  It is not used.  Apparently the relevant parts
were moved to StdChronoDurationPrinter._ratio at some point in the
past.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (std_ratio_t_tuple):
	Remove.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes the std_ratio_t_tuple function from the Python
pretty-printer code.  It is not used.  Apparently the relevant parts
were moved to StdChronoDurationPrinter._ratio at some point in the
past.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (std_ratio_t_tuple):
	Remove.
</pre>
</div>
</content>
</entry>
</feed>
