From d1f5a920341d29963c65c6cee71e3146e7418fb2 Mon Sep 17 00:00:00 2001 From: "Michael X. Grey" Date: Tue, 30 Jan 2018 21:59:59 -0800 Subject: [PATCH 1/2] Port clang warning fix over to 6.4 --- dart/common/detail/CompositeData.hpp | 31 +++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/dart/common/detail/CompositeData.hpp b/dart/common/detail/CompositeData.hpp index 2a08d62307728..1805d086331fd 100644 --- a/dart/common/detail/CompositeData.hpp +++ b/dart/common/detail/CompositeData.hpp @@ -47,13 +47,38 @@ namespace dart { namespace common { namespace detail { +//============================================================================== +// This default template definition will be called when AspectOrComposite is +// an Aspect. +template +struct GetAspectImpl +{ + using Type = AspectOrComposite; +}; + +//============================================================================== +// This template specialization will be called when AspectOrComposite is not +// an Aspect (and is presumably a composite that defines a nested Aspect type). +template +struct GetAspectImpl +{ + // If you get a compiler error that leads you here, then you are trying to + // ask for the Aspect of an object that is not associated with any Aspect. + // That means it does not define a nested Aspect type (such as how + // RevoluteJoint defines the RevoluteJoint::Aspect). + // + // Whatever function is leading to the error must be given a template type + // that either defines a nested type with the name Aspect, or else inherits + // from the type dart::common::Aspect. + using Type = typename AspectOrComposite::Aspect; +}; + //============================================================================== template struct GetAspect { - using Type = typename std::conditional< - std::is_base_of::value, - AspectT, typename AspectT::Aspect>::type; + using Type = typename GetAspectImpl< + AspectT, std::is_base_of::value>::Type; }; //============================================================================== From e65f57e7b505a58a0c5c52e1368c310c437f6483 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Thu, 1 Feb 2018 07:45:02 -0800 Subject: [PATCH 2/2] Update changelog for #964 (#966) --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78f54127008ac..ca7ad0278f0a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,9 @@ * Misc - * Add World::create(): [#962](https://github.com/dartsim/dart/pull/962) - * Suppressed warnings: [#937](https://github.com/dartsim/dart/pull/937) + * Added World::create(): [#962](https://github.com/dartsim/dart/pull/962) + * Suppressed -Winjected-class-name warnings from Clang 5.0.0: [#964](https://github.com/dartsim/dart/pull/964) + * Suppressed -Wdangling-else warnings from GCC 7.2.0: [#937](https://github.com/dartsim/dart/pull/937) * Fixed various build issues with Visual Studio: [#956](https://github.com/dartsim/dart/pull/956) ### [DART 6.3.0 (2017-10-04)](https://github.com/dartsim/dart/milestone/36?closed=1)