mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-15 16:36:03 +08:00
Fix uninitialised warning in etl::optional (#381)
The constructors of etl::optional with no argument or with etl::nullopt_t argument do not initalise the storage data member. When compiling with gcc with some specific optimisation levels, this can generate a -Wmaybe-uninitialized diagnostic warning.
This commit is contained in:
parent
fc6609276c
commit
42546176a9
@ -112,7 +112,8 @@ namespace etl
|
||||
/// Constructor.
|
||||
//***************************************************************************
|
||||
optional()
|
||||
: valid(false)
|
||||
: storage()
|
||||
, valid(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -120,7 +121,8 @@ namespace etl
|
||||
/// Constructor with nullopt.
|
||||
//***************************************************************************
|
||||
optional(etl::nullopt_t)
|
||||
: valid(false)
|
||||
: storage()
|
||||
, valid(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user