Skip to content

Commit 91dff36

Browse files
author
Vladimir 'virtul' Ivannikov
committed
variant,tuple: fix/silence misc warnings
msvc: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/c5267 Similar to neighboring C4625 Fix for warnings (errors in /WX mode) like .../variant.h(759): warning C5267: definition of implicit copy constructor for '...' is deprecated because it has a user-provided destructor (ditto for tuple). Also fix for -Wunused-parameter in variant.h (`visit_throw_bad_variant_access`)
1 parent 7fadbf0 commit 91dff36

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

include/EASTL/tuple.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
EA_DISABLE_VC_WARNING(4623) // warning C4623: default constructor was implicitly defined as deleted
1717
EA_DISABLE_VC_WARNING(4625) // warning C4625: copy constructor was implicitly defined as deleted
1818
EA_DISABLE_VC_WARNING(4510) // warning C4510: default constructor could not be generated
19+
EA_DISABLE_VC_WARNING(5267) // warning C5267: definition of implicit copy constructor for '...' is deprecated because it has a user-provided assignment operator
20+
1921

2022
#if EASTL_TUPLE_ENABLED
2123

@@ -991,4 +993,5 @@ EA_CONSTEXPR decltype(auto) apply(F&& f, Tuple&& t)
991993
EA_RESTORE_VC_WARNING()
992994
EA_RESTORE_VC_WARNING()
993995
EA_RESTORE_VC_WARNING()
996+
EA_RESTORE_VC_WARNING()
994997
#endif // EASTL_TUPLE_H

include/EASTL/variant.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
static_assert(false, "eastl::variant requires a C++14 compatible compiler (at least) ");
8282
#endif
8383

84-
EA_DISABLE_VC_WARNING(4625) // copy constructor was implicitly defined as deleted
84+
EA_DISABLE_VC_WARNING(4625 5267) // copy constructor was implicitly defined as deleted
8585

8686
namespace eastl
8787
{
@@ -1336,9 +1336,8 @@ namespace eastl
13361336
// variant<int, long, string> v = "Hello, Variant";
13371337
// visit(MyVisitor{}, v); // calls MyVisitor::operator()(string) {}
13381338
//
1339-
EA_DISABLE_VC_WARNING(4100) // warning C4100: 't': unreferenced formal parameter
13401339
template <typename... Variants>
1341-
static EA_CPP14_CONSTEXPR void visit_throw_bad_variant_access(Variants&&... variants)
1340+
static EA_CPP14_CONSTEXPR void visit_throw_bad_variant_access(EA_MAYBE_UNUSED Variants&&... variants)
13421341
{
13431342
#if EASTL_EXCEPTIONS_ENABLED
13441343
using bool_array_type = bool[];
@@ -1352,7 +1351,6 @@ namespace eastl
13521351
}
13531352
#endif
13541353
}
1355-
EA_RESTORE_VC_WARNING()
13561354

13571355
template <typename... Variants>
13581356
static EA_CONSTEXPR void visit_static_assert_check(Variants&&...)

0 commit comments

Comments
 (0)