mirror of git://gcc.gnu.org/git/gcc.git
Define special members as defaulted
* include/bits/ios_base.h (ios::Init::Init(const Init&)) (ios::Init::operator=): Define as defaulted. * include/bits/stl_bvector.h (_Bit_reference(const _Bit_reference&)): Likewise. * include/bits/stream_iterator.h (istream_iterator::operator=) (ostream_iterator::operator=): Likewise. * include/bits/streambuf_iterator.h (istreambuf_iterator::operator=) Likewise. * include/std/bitset (bitset::reference::reference(const reference&)): Likewise. * include/std/complex (complex<float>::complex(const complex&)) (complex<double>::complex(const complex&)) (complex<long double>::complex(const complex&)): Likewise. From-SVN: r261338
This commit is contained in:
parent
29a50dfb47
commit
a14175560c
|
|
@ -1,3 +1,19 @@
|
||||||
|
2018-06-08 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
* include/bits/ios_base.h (ios::Init::Init(const Init&))
|
||||||
|
(ios::Init::operator=): Define as defaulted.
|
||||||
|
* include/bits/stl_bvector.h (_Bit_reference(const _Bit_reference&)):
|
||||||
|
Likewise.
|
||||||
|
* include/bits/stream_iterator.h (istream_iterator::operator=)
|
||||||
|
(ostream_iterator::operator=): Likewise.
|
||||||
|
* include/bits/streambuf_iterator.h (istreambuf_iterator::operator=)
|
||||||
|
Likewise.
|
||||||
|
* include/std/bitset (bitset::reference::reference(const reference&)):
|
||||||
|
Likewise.
|
||||||
|
* include/std/complex (complex<float>::complex(const complex&))
|
||||||
|
(complex<double>::complex(const complex&))
|
||||||
|
(complex<long double>::complex(const complex&)): Likewise.
|
||||||
|
|
||||||
2018-06-07 Jonathan Wakely <jwakely@redhat.com>
|
2018-06-07 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
* include/bits/regex.h (sub_match): Add noexcept to default
|
* include/bits/regex.h (sub_match): Add noexcept to default
|
||||||
|
|
|
||||||
|
|
@ -607,6 +607,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
Init();
|
Init();
|
||||||
~Init();
|
~Init();
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
Init(const Init&) = default;
|
||||||
|
Init& operator=(const Init&) = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static _Atomic_word _S_refcount;
|
static _Atomic_word _S_refcount;
|
||||||
static bool _S_synced_with_stdio;
|
static bool _S_synced_with_stdio;
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
|
|
||||||
_Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { }
|
_Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { }
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
_Bit_reference(const _Bit_reference&) = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
operator bool() const _GLIBCXX_NOEXCEPT
|
operator bool() const _GLIBCXX_NOEXCEPT
|
||||||
{ return !!(*_M_p & _M_mask); }
|
{ return !!(*_M_p & _M_mask); }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
_M_ok(__obj._M_ok)
|
_M_ok(__obj._M_ok)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
istream_iterator& operator=(const istream_iterator&) = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
const _Tp&
|
const _Tp&
|
||||||
operator*() const
|
operator*() const
|
||||||
{
|
{
|
||||||
|
|
@ -188,6 +192,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
ostream_iterator(const ostream_iterator& __obj)
|
ostream_iterator(const ostream_iterator& __obj)
|
||||||
: _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
|
: _M_stream(__obj._M_stream), _M_string(__obj._M_string) { }
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
ostream_iterator& operator=(const ostream_iterator&) = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Writes @a value to underlying ostream using operator<<. If
|
/// Writes @a value to underlying ostream using operator<<. If
|
||||||
/// constructed with delimiter string, writes delimiter to ostream.
|
/// constructed with delimiter string, writes delimiter to ostream.
|
||||||
ostream_iterator&
|
ostream_iterator&
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
istreambuf_iterator(streambuf_type* __s) _GLIBCXX_USE_NOEXCEPT
|
istreambuf_iterator(streambuf_type* __s) _GLIBCXX_USE_NOEXCEPT
|
||||||
: _M_sbuf(__s), _M_c(traits_type::eof()) { }
|
: _M_sbuf(__s), _M_c(traits_type::eof()) { }
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
istreambuf_iterator&
|
||||||
|
operator=(const istreambuf_iterator&) noexcept = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
/// Return the current character pointed to by iterator. This returns
|
/// Return the current character pointed to by iterator. This returns
|
||||||
/// streambuf.sgetc(). It cannot be assigned. NB: The result of
|
/// streambuf.sgetc(). It cannot be assigned. NB: The result of
|
||||||
/// operator*() on an end of stream is undefined.
|
/// operator*() on an end of stream is undefined.
|
||||||
|
|
|
||||||
|
|
@ -816,6 +816,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
|
||||||
_M_bpos = _Base::_S_whichbit(__pos);
|
_M_bpos = _Base::_S_whichbit(__pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
reference(const reference&) = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
~reference() _GLIBCXX_NOEXCEPT
|
~reference() _GLIBCXX_NOEXCEPT
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1158,7 +1158,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
|
|
||||||
// Let the compiler synthesize the copy and assignment
|
// Let the compiler synthesize the copy and assignment
|
||||||
// operator. It always does a pretty good job.
|
// operator. It always does a pretty good job.
|
||||||
// complex& operator=(const complex&);
|
#if __cplusplus >= 201103L
|
||||||
|
_GLIBCXX14_CONSTEXPR complex& operator=(const complex&) = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
complex&
|
complex&
|
||||||
|
|
@ -1308,7 +1310,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
// The compiler will synthesize this, efficiently.
|
// The compiler will synthesize this, efficiently.
|
||||||
// complex& operator=(const complex&);
|
#if __cplusplus >= 201103L
|
||||||
|
_GLIBCXX14_CONSTEXPR complex& operator=(const complex&) = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
complex&
|
complex&
|
||||||
|
|
@ -1460,7 +1464,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
// The compiler knows how to do this efficiently
|
// The compiler knows how to do this efficiently
|
||||||
// complex& operator=(const complex&);
|
#if __cplusplus >= 201103L
|
||||||
|
_GLIBCXX14_CONSTEXPR complex& operator=(const complex&) = default;
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename _Tp>
|
template<typename _Tp>
|
||||||
complex&
|
complex&
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue