diff --git a/Framework/DataObjects/src/MDFramesToSpecialCoordinateSystem.cpp b/Framework/DataObjects/src/MDFramesToSpecialCoordinateSystem.cpp index e597689320eb463b494090dc2e0c91e05cd9f35e..8331e3b173e70605c8a0b67c259f478cdd8f34e6 100644 --- a/Framework/DataObjects/src/MDFramesToSpecialCoordinateSystem.cpp +++ b/Framework/DataObjects/src/MDFramesToSpecialCoordinateSystem.cpp @@ -1,6 +1,7 @@ #include "MantidDataObjects/MDFramesToSpecialCoordinateSystem.h" #include "MantidAPI/IMDEventWorkspace.h" #include "MantidAPI/IMDHistoWorkspace.h" +#include "MantidKernel/WarningSuppressions.h" namespace Mantid { namespace DataObjects { @@ -9,6 +10,8 @@ MDFramesToSpecialCoordinateSystem::MDFramesToSpecialCoordinateSystem() {} MDFramesToSpecialCoordinateSystem::~MDFramesToSpecialCoordinateSystem() {} +// Need to turn off the warnings because of boost optional being used. +GCC_DIAG_OFF(maybe-uninitialized) /** * Get the Special Coordinate System based on the MDFrame information. * @param workspace: the workspace which is being queried @@ -57,6 +60,7 @@ boost::optional<Mantid::Kernel::SpecialCoordinateSystem> return output; } +GCC_DIAG_ON(maybe-uninitialized) /** * Make sure that the QFrame types are the same. diff --git a/Framework/DataObjects/src/MDHistoWorkspace.cpp b/Framework/DataObjects/src/MDHistoWorkspace.cpp index 6e9b7acca20b18af1cec5c2116fa73e0ae67dea4..97c197b3e999609457128328dd4d728a1f5dc3d1 100644 --- a/Framework/DataObjects/src/MDHistoWorkspace.cpp +++ b/Framework/DataObjects/src/MDHistoWorkspace.cpp @@ -3,6 +3,7 @@ #include "MantidKernel/System.h" #include "MantidKernel/Utils.h" #include "MantidKernel/VMD.h" +#include "MantidKernel/WarningSuppressions.h" #include "MantidDataObjects/MDHistoWorkspace.h" #include "MantidDataObjects/MDHistoWorkspaceIterator.h" #include "MantidDataObjects/MDFramesToSpecialCoordinateSystem.h" @@ -1213,9 +1214,11 @@ uint64_t MDHistoWorkspace::sumNContribEvents() const { return sum; } + /** * Get the Q frame system (if any) to use. */ +GCC_DIAG_OFF(strict-aliasing) Kernel::SpecialCoordinateSystem MDHistoWorkspace::getSpecialCoordinateSystem() const { MDFramesToSpecialCoordinateSystem converter; @@ -1227,6 +1230,8 @@ MDHistoWorkspace::getSpecialCoordinateSystem() const { return coordinates; } +GCC_DIAG_ON(strict-aliasing) + /** Set the special coordinate system (if any) to use. diff --git a/Framework/MDAlgorithms/test/ConvertToReflectometryQTest.h b/Framework/MDAlgorithms/test/ConvertToReflectometryQTest.h index 382e63bc6c49ee948f2b2b6e94891e53a99393be..2804987b76ddcb4959bc4d720b36597272997fb3 100644 --- a/Framework/MDAlgorithms/test/ConvertToReflectometryQTest.h +++ b/Framework/MDAlgorithms/test/ConvertToReflectometryQTest.h @@ -160,9 +160,6 @@ public: const auto &frame0 = ws->getDimension(0)->getMDFrame(); TSM_ASSERT_EQUALS("Should be a QLab frame", Mantid::Geometry::QLab::QLabName, frame0.name()); - TSM_ASSERT_THROWS_NOTHING( - "Should be a QLab frame", - const auto &tmp = dynamic_cast<const Mantid::Geometry::QLab &>(frame0)); TSM_ASSERT_EQUALS( "Should have a special coordinate system selection of QLab", ws->getSpecialCoordinateSystem(), Mantid::Kernel::QLab);