aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-25 10:10:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-25 10:10:34 +0200
commiteb04e019af8571714d1a8fb2aee900ee0a47767b (patch)
treec221e42e0f76b51f8f99eb95ab2da172c8d8640d
parentba4c2994efdd1210304f7e833d291fd64cf5d828 (diff)
Add workaround for GCC 4.8 bug in default initialization of union member
It appears to silently ignore this C++11 feature and leave the data uninitialized.
-rw-r--r--build2/cli/target12
1 files changed, 9 insertions, 3 deletions
diff --git a/build2/cli/target b/build2/cli/target
index 065639b..8acdcf4 100644
--- a/build2/cli/target
+++ b/build2/cli/target
@@ -29,8 +29,6 @@ namespace build2
class cli_cxx: public mtime_target
{
public:
- using mtime_target::mtime_target;
-
union
{
// It is theoretically possible that the compiler will add
@@ -46,9 +44,17 @@ namespace build2
cxx::cxx* c;
cxx::ixx* i;
};
- target* m[3] = {nullptr, nullptr, nullptr};
+ target* m[3] /*= {nullptr, nullptr, nullptr}*/; // @@ GCC 4.8
};
+ //using mtime_target::mtime_target; // @@ GCC 4.8
+
+ cli_cxx (dir_path d, dir_path o, string n, const string* e)
+ : mtime_target (move (d), move (o), move (n), e)
+ {
+ m[0] = m[1] = m[2] = nullptr;
+ }
+
virtual group_view
group_members (action_type) const;