diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-01-10 15:27:39 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2020-01-10 15:27:39 +0000 |
commit | 7918cb93f6f752cec468f107eb944dc0da61ec6b (patch) | |
tree | c28d83e2ee9e985e1032aeb5deeeae5013195255 /gcc/go | |
parent | d5c23c6ceacf666f218676b648801379044e326a (diff) | |
download | gcc-7918cb93f6f752cec468f107eb944dc0da61ec6b.zip gcc-7918cb93f6f752cec468f107eb944dc0da61ec6b.tar.gz gcc-7918cb93f6f752cec468f107eb944dc0da61ec6b.tar.bz2 |
libstdc++: Make istreambuf_iterator base class consistent (PR92285)
Since LWG 445 was implemented for GCC 4.7, the std::iterator base class
of std::istreambuf_iterator changes type depending on the -std mode
used. This creates an ABI incompatibility between different -std modes.
This change ensures the base class always has the same type. This makes
layout for C++98 compatible with the current -std=gnu++14 default, but
no longer compatible with C++98 code from previous releases. In practice
this is unlikely to cause real problems, because it only affects the
layout of types with two std::iterator base classes, one of which comes
from std::istreambuf_iterator. Such types are expected to be vanishingly
rare.
PR libstdc++/92285
* include/bits/streambuf_iterator.h (istreambuf_iterator): Make type
of base class independent of __cplusplus value.
[__cplusplus < 201103L] (istreambuf_iterator::reference): Override the
type defined in the base class
* testsuite/24_iterators/istreambuf_iterator/92285.cc: New test.
* testsuite/24_iterators/istreambuf_iterator/requirements/
base_classes.cc: Adjust expected base class for C++98.
From-SVN: r280116
Diffstat (limited to 'gcc/go')
0 files changed, 0 insertions, 0 deletions