diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-08-27 13:30:42 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2024-08-27 14:20:13 +0100 |
commit | 75ef21665cb924265b818b08babbc7ec3108c876 (patch) | |
tree | fc25c9f69210003d6f533fa5696a63d83fef08eb /libstdc++-v3/python | |
parent | 470a27859d8a47a99f389f1dc6edb82c08b16e21 (diff) | |
download | gcc-75ef21665cb924265b818b08babbc7ec3108c876.zip gcc-75ef21665cb924265b818b08babbc7ec3108c876.tar.gz gcc-75ef21665cb924265b818b08babbc7ec3108c876.tar.bz2 |
libstdc++: Do not use std::vector<bool>::reference default ctor [PR115098]
This default constructor was made private by r15-3124-gb25b101bc38000 so
the pretty printer tests need a fix to stop using it. There's no
conforming way to get a default-constructed 'reference' now, e.g. trying
to access an element of a default-constructed std::vector<bool> will
trigger an assertion. Remove the tests, but leave a comment in the
printer code about handling it.
libstdc++-v3/ChangeLog:
PR libstdc++/115098
* python/libstdcxx/v6/printers.py (StdBitReferencePrinter): Add
comment.
* testsuite/libstdc++-prettyprinters/simple.cc: Do not default
construct std::vector<bool>::reference.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
Diffstat (limited to 'libstdc++-v3/python')
-rw-r--r-- | libstdc++-v3/python/libstdcxx/v6/printers.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index a6c2ed4..9210493 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -613,6 +613,9 @@ class StdBitReferencePrinter(printer_base): def to_string(self): if not self._val['_M_p']: + # PR libstdc++/115098 removed the reference default constructor + # that this case relates to. New code should never need this, + # but we still handle it for compatibility with old binaries. return 'invalid std::vector<bool>::reference' return bool(self._val['_M_p'].dereference() & (self._val['_M_mask'])) |