Skip to content

Commit 9e74964

Browse files
authored
Fix -Werror=maybe-uninitialized with GCC 12 for ARM64 (#307)
1 parent 14fdcc2 commit 9e74964

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

include/fastcdr/xcdr/optional.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ class optional
207207
//! Assigns content from an optional.
208208
optional& operator =(
209209
const optional& opt)
210+
#if defined(__GNUC__) && __GNUC__ == 12
211+
__attribute__(
212+
(noinline))
213+
#endif // if defined(__GNUC__) && __GNUC__ == 12
210214
{
211215
reset();
212216
storage_.engaged_ = opt.storage_.engaged_;
@@ -304,7 +308,7 @@ class optional
304308
*
305309
* @return The contained value.
306310
*/
307-
T&& operator *() && noexcept
311+
T && operator *() && noexcept
308312
{
309313
return std::move(storage_.val_);
310314
}
@@ -316,7 +320,7 @@ class optional
316320
*
317321
* @return The contained value.
318322
*/
319-
const T&& operator *() const&& noexcept
323+
const T && operator*() const && noexcept
320324
{
321325
return std::move(storage_.val_);
322326
}

0 commit comments

Comments
 (0)