From f57798131d7ef01d6214f318ccff42f2281d64cd Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 1 Nov 2022 08:58:59 -0500 Subject: [PATCH 1/2] Suppress MSVC false-positive Signed-off-by: Michael Carroll --- include/gz/physics/FeatureList.hh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/gz/physics/FeatureList.hh b/include/gz/physics/FeatureList.hh index 75dacf698..de8f99b05 100644 --- a/include/gz/physics/FeatureList.hh +++ b/include/gz/physics/FeatureList.hh @@ -22,6 +22,14 @@ #include +#if defined(_MSC_VER) +#pragma warning(push) +/// Suppress warnings about "base-class is already a base-class" +/// Typically, this would indicate a diamond pattern in inheritance, +/// but this is a false positive for the plugin mechanism. +#pragma warning(disable: 4584) +#endif // defined(_MSC_VER) + namespace gz { namespace physics @@ -111,4 +119,7 @@ namespace gz #include -#endif +#if defined(_MSC_VER) +#pragma warning(pop) +#endif // defined(_MSC_VER) +#endif // GZ_PHYSICS_FEATURELIST_HH_ From 737ac8612bc55b595a5928258f7c813bbaeb1b52 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 1 Nov 2022 09:52:43 -0500 Subject: [PATCH 2/2] Update comment for accuracy Signed-off-by: Michael Carroll --- include/gz/physics/FeatureList.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/gz/physics/FeatureList.hh b/include/gz/physics/FeatureList.hh index de8f99b05..b4e3e8a53 100644 --- a/include/gz/physics/FeatureList.hh +++ b/include/gz/physics/FeatureList.hh @@ -26,7 +26,9 @@ #pragma warning(push) /// Suppress warnings about "base-class is already a base-class" /// Typically, this would indicate a diamond pattern in inheritance, -/// but this is a false positive for the plugin mechanism. +/// but there are uses in the plugin mechanism recursive templates. +/// The templates have no base classes, so there are no ambiguity +/// concerns, so we can safely suppress the warning here. #pragma warning(disable: 4584) #endif // defined(_MSC_VER)