From: Simon Marchi Date: Tue, 21 Feb 2017 16:48:49 +0000 (-0500) Subject: Default initialize enum flags to 0 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b90b1390679473dd84416e462afa1587769ceec;p=binutils-gdb.git Default initialize enum flags to 0 ... so that we don't need to do it manually, and potentially forget. For example, this allows to do: my_flags flags; ... flags |= some_flag; gdb/ChangeLog: * common/enum-flags.h (enum_flags::enum_flags): Initialize m_enum_value to 0 in default constructor. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 49ffd4a8a76..1e0e50e0636 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-02-21 Simon Marchi + + * common/enum-flags.h (enum_flags::enum_flags): Initialize + m_enum_value to 0 in default constructor. + 2017-02-21 Edjunior Barbosa Machado * rs6000-tdep.c (LOAD_AND_RESERVE_MASK): Rename from LWARX_MASK. diff --git a/gdb/common/enum-flags.h b/gdb/common/enum-flags.h index 5b8c3ebc323..e63c8a46bd8 100644 --- a/gdb/common/enum-flags.h +++ b/gdb/common/enum-flags.h @@ -115,8 +115,9 @@ private: } public: - /* Allow default construction, just like raw enums. */ + /* Allow default construction. */ enum_flags () + : m_enum_value ((enum_type) 0) {} enum_flags (const enum_flags &other)