aboutsummaryrefslogtreecommitdiff
path: root/build2/cli/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-08 09:24:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commit8aee78c8d0eb06334571e596f6fbdf7ed5756f0c (patch)
tree12899b0b09c8fcbaf3a1064b28db8f6161003cbe /build2/cli/target.cxx
parent5cefca444f7062c61cc9d118ffea5901e05186fd (diff)
Tighten target constness further
Diffstat (limited to 'build2/cli/target.cxx')
-rw-r--r--build2/cli/target.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/build2/cli/target.cxx b/build2/cli/target.cxx
index 48dc95b..200f6f0 100644
--- a/build2/cli/target.cxx
+++ b/build2/cli/target.cxx
@@ -32,10 +32,15 @@ namespace build2
// cli.cxx
//
group_view cli_cxx::
- group_members (action_type) const
+ group_members (action_type)
{
+ static_assert (offsetof (cli_cxx_members, i) -
+ offsetof (cli_cxx_members, h) == sizeof (target*) * 2,
+ "member layout incompatible with array");
+
return h != nullptr
- ? group_view {m, (i != nullptr ? 3U : 2U)}
+ ? group_view {reinterpret_cast<target* const*> (&h),
+ (i != nullptr ? 3U : 2U)}
: group_view {nullptr, 0};
}