aboutsummaryrefslogtreecommitdiff
path: root/gdb/common
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-02-21 11:48:49 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2017-02-21 11:48:49 -0500
commit1b90b1390679473dd84416e462afa1587769ceec (patch)
tree9982f3cbcb9a359802dc572df811590e2db9fd55 /gdb/common
parent2039d74e780db6659c87cd3c426d526615cfe703 (diff)
downloadgdb-1b90b1390679473dd84416e462afa1587769ceec.zip
gdb-1b90b1390679473dd84416e462afa1587769ceec.tar.gz
gdb-1b90b1390679473dd84416e462afa1587769ceec.tar.bz2
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.
Diffstat (limited to 'gdb/common')
-rw-r--r--gdb/common/enum-flags.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/common/enum-flags.h b/gdb/common/enum-flags.h
index 5b8c3ebc..e63c8a4 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)