Skip to content

Commit 8bc4a16

Browse files
committed
Merge branch 'develop'
2 parents aaabe89 + ecb241a commit 8bc4a16

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

include/boost/optional/detail/union_optional.hpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,20 @@ union constexpr_union_storage_t
7474

7575
constexpr constexpr_union_storage_t( trivial_init_t ) noexcept : dummy_() {};
7676

77+
#if defined(BOOST_GCC) && (__GNUC__ >= 7)
78+
// false positive, see https://github.com/boostorg/variant2/issues/55,
79+
// https://github.com/boostorg/url/issues/979
80+
# pragma GCC diagnostic push
81+
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
82+
#endif
83+
7784
template <class... Args>
7885
constexpr constexpr_union_storage_t( Args&&... args ) : value_(forward_<Args>(args)...) {}
7986

87+
#if defined(BOOST_GCC) && (__GNUC__ >= 7)
88+
# pragma GCC diagnostic pop
89+
#endif
90+
8091
//~constexpr_union_storage_t() = default; // No need to destroy a trivially-destructible type
8192
};
8293

@@ -88,9 +99,20 @@ union fallback_union_storage_t
8899

89100
constexpr fallback_union_storage_t( trivial_init_t ) noexcept : dummy_() {};
90101

102+
#if defined(BOOST_GCC) && (__GNUC__ >= 7)
103+
// false positive, see https://github.com/boostorg/variant2/issues/55,
104+
// https://github.com/boostorg/url/issues/979
105+
# pragma GCC diagnostic push
106+
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
107+
#endif
108+
91109
template <class... Args>
92110
constexpr fallback_union_storage_t( Args&&... args ) : value_(forward_<Args>(args)...) {}
93111

112+
#if defined(BOOST_GCC) && (__GNUC__ >= 7)
113+
# pragma GCC diagnostic pop
114+
#endif
115+
94116
~fallback_union_storage_t(){} // My owner will destroy the `T` if needed.
95117
// Cannot default in a union with nontrivial `T`.
96118
};

test/optional_test_convert_from_T.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ void test_optional_of_superconverting_T() // compile-time test
4545
superconv<optional<int> > s;
4646
superconv<optional<int> > & rs = s;
4747
optional<superconv<optional<int> > > os = rs;
48+
(void)s;
49+
(void)os;
4850
#endif
4951
}
5052

test/optional_test_inplace_factory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ template <typename CharT>
111111
struct basic_formatter
112112
{
113113
template< typename FunT >
114-
basic_formatter(FunT&& fun) {}
114+
basic_formatter(FunT&&) {}
115115

116116
template< typename FunT >
117-
basic_formatter& operator= (FunT&& fun)
117+
basic_formatter& operator= (FunT&&)
118118
{
119119
return *this;
120120
}

0 commit comments

Comments
 (0)