From eb04e019af8571714d1a8fb2aee900ee0a47767b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 25 Apr 2016 10:10:34 +0200 Subject: 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. --- build2/cli/target | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'build2/cli') 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; -- cgit v1.1