Skip to content

Commit

Permalink
Add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yufengwangca committed Jan 27, 2022
1 parent 12f8b40 commit 926ccc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/core/Optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,13 @@ class Optional
{
if (mHasValue)
{
// The -Wmaybe-uninitialized warning gets confused about the fact
// that other.mValue is always initialized if other.mHasValue is
// true, so suppress it for our access to other.mValue.
#pragma GCC diagnostic push
#if !defined(__clang__)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#endif // !defined(__clang__)
new (&mValue.mData) T(other.mValue.mData);
#pragma GCC diagnostic pop
}
Expand Down

0 comments on commit 926ccc5

Please sign in to comment.