mirror of
https://github.com/boostorg/optional.git
synced 2026-06-11 20:01:10 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8bc4a16933 | |||
| ecb241a919 | |||
| ff710d113c | |||
| 88e2378c8a |
@@ -74,9 +74,20 @@ union constexpr_union_storage_t
|
||||
|
||||
constexpr constexpr_union_storage_t( trivial_init_t ) noexcept : dummy_() {};
|
||||
|
||||
#if defined(BOOST_GCC) && (__GNUC__ >= 7)
|
||||
// false positive, see https://github.com/boostorg/variant2/issues/55,
|
||||
// https://github.com/boostorg/url/issues/979
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
|
||||
template <class... Args>
|
||||
constexpr constexpr_union_storage_t( Args&&... args ) : value_(forward_<Args>(args)...) {}
|
||||
|
||||
#if defined(BOOST_GCC) && (__GNUC__ >= 7)
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
//~constexpr_union_storage_t() = default; // No need to destroy a trivially-destructible type
|
||||
};
|
||||
|
||||
@@ -88,9 +99,20 @@ union fallback_union_storage_t
|
||||
|
||||
constexpr fallback_union_storage_t( trivial_init_t ) noexcept : dummy_() {};
|
||||
|
||||
#if defined(BOOST_GCC) && (__GNUC__ >= 7)
|
||||
// false positive, see https://github.com/boostorg/variant2/issues/55,
|
||||
// https://github.com/boostorg/url/issues/979
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
|
||||
template <class... Args>
|
||||
constexpr fallback_union_storage_t( Args&&... args ) : value_(forward_<Args>(args)...) {}
|
||||
|
||||
#if defined(BOOST_GCC) && (__GNUC__ >= 7)
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
~fallback_union_storage_t(){} // My owner will destroy the `T` if needed.
|
||||
// Cannot default in a union with nontrivial `T`.
|
||||
};
|
||||
|
||||
@@ -45,6 +45,8 @@ void test_optional_of_superconverting_T() // compile-time test
|
||||
superconv<optional<int> > s;
|
||||
superconv<optional<int> > & rs = s;
|
||||
optional<superconv<optional<int> > > os = rs;
|
||||
(void)s;
|
||||
(void)os;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -111,10 +111,10 @@ template <typename CharT>
|
||||
struct basic_formatter
|
||||
{
|
||||
template< typename FunT >
|
||||
basic_formatter(FunT&& fun) {}
|
||||
basic_formatter(FunT&&) {}
|
||||
|
||||
template< typename FunT >
|
||||
basic_formatter& operator= (FunT&& fun)
|
||||
basic_formatter& operator= (FunT&&)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user