mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Only add diagnostics to GCC, Clang doesn't know the warning
This commit is contained in:
parent
6562c41ae1
commit
9e981abe05
|
@ -163,8 +163,10 @@ public:
|
|||
/// </summary>
|
||||
void set(const T &value) noexcept(XLNT_NOEXCEPT_VALUE_COMPAT(set_copy_noexcept_t{}))
|
||||
{
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
if (has_value_)
|
||||
{
|
||||
value_ref() = value;
|
||||
|
@ -174,7 +176,9 @@ public:
|
|||
new (&storage_) T(value);
|
||||
has_value_ = true;
|
||||
}
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -186,8 +190,10 @@ public:
|
|||
// 1. have to deal with implicit conversions internally with perfect forwarding
|
||||
// 2. have to deal with the noexcept specfiers for all the different variations
|
||||
// overload is just far and away the simpler solution
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
if (has_value_)
|
||||
{
|
||||
value_ref() = std::move(value);
|
||||
|
@ -197,7 +203,9 @@ public:
|
|||
new (&storage_) T(std::move(value));
|
||||
has_value_ = true;
|
||||
}
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue
Block a user