Skip to content

Commit 6aad054

Browse files
Merge pull request #38445 from peterfpeterson/gcc13_ornlnext
Update gcc to version 13 - ornlnext
2 parents f11ea39 + d8ddefa commit 6aad054

File tree

70 files changed

+244
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+244
-110
lines changed

Framework/API/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
2-
add_compile_options(-Wno-maybe-uninitialized)
2+
add_compile_options(-Wno-uninitialized)
33
endif()
44

55
if(CXXTEST_FOUND)

Framework/Algorithms/src/FitPeaks.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "MantidKernel/ListValidator.h"
3535
#include "MantidKernel/StartsWithValidator.h"
3636
#include "MantidKernel/VectorHelper.h"
37+
#include "MantidKernel/WarningSuppressions.h"
3738

3839
#include "boost/algorithm/string.hpp"
3940
#include "boost/algorithm/string/trim.hpp"
@@ -2118,6 +2119,8 @@ size_t FitPeaks::histRangeToDataPointCount(size_t iws, const std::pair<double, d
21182119
return number_dp;
21192120
}
21202121

2122+
GNU_DIAG_OFF("dangling-reference")
2123+
21212124
//----------------------------------------------------------------------------------------------
21222125
/** Convert a histogram range to vector index boundaries
21232126
* @param iws :: histogram index in workspace
@@ -2172,6 +2175,8 @@ void FitPeaks::getRangeData(size_t iws, const std::pair<double, double> &range,
21722175
std::copy(orig_e.begin() + left_index, orig_e.begin() + left_index + num_datapoints, vec_e.begin());
21732176
}
21742177

2178+
GNU_DIAG_ON("dangling-reference")
2179+
21752180
//----------------------------------------------------------------------------------------------
21762181
/** Calculate signal-to-noise ratio in a histogram range
21772182
* @param iws :: histogram index in workspace

Framework/Algorithms/src/SofQWCentre.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "MantidGeometry/Instrument.h"
1414
#include "MantidGeometry/Instrument/DetectorInfo.h"
1515
#include "MantidKernel/PhysicalConstants.h"
16+
#include "MantidKernel/WarningSuppressions.h"
1617

1718
namespace Mantid::Algorithms {
1819

@@ -27,6 +28,8 @@ using namespace API;
2728
*/
2829
void SofQWCentre::init() { SofQW::createCommonInputProperties(*this); }
2930

31+
GNU_DIAG_OFF("dangling-reference")
32+
3033
void SofQWCentre::exec() {
3134
using namespace Geometry;
3235
using PhysicalConstants::E_mev_toNeutronWavenumberSq;
@@ -150,6 +153,8 @@ void SofQWCentre::exec() {
150153
prog.report();
151154
}
152155

156+
GNU_DIAG_ON("dangling-reference")
157+
153158
// If the input workspace was a distribution, need to divide by q bin width
154159
if (inputWorkspace->isDistribution())
155160
this->makeDistribution(*outputWorkspace, verticalAxis);

Framework/Algorithms/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
2-
add_compile_options(-Wno-maybe-uninitialized)
2+
add_compile_options(-Wno-uninitialized)
33
endif()
44

55
if(CXXTEST_FOUND)

Framework/Algorithms/test/CalculateCarpenterSampleCorrectionTest.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "MantidFrameworkTestHelpers/WorkspaceCreationHelper.h"
1919
#include "MantidHistogramData/LinearGenerator.h"
2020
#include "MantidIndexing/IndexInfo.h"
21+
#include "MantidKernel/WarningSuppressions.h"
2122

2223
using namespace Mantid;
2324
using namespace Mantid::API;
@@ -189,6 +190,8 @@ class CalculateCarpenterSampleCorrectionTest : public CxxTest::TestSuite {
189190
AnalysisDataService::Instance().remove("TestOutputWS");
190191
}
191192

193+
GNU_DIAG_OFF("dangling-reference")
194+
192195
void testCalculationEvent() {
193196
const std::string outName("CalculateCarpenterSampleCorrectionEventOutput");
194197

@@ -255,6 +258,8 @@ class CalculateCarpenterSampleCorrectionTest : public CxxTest::TestSuite {
255258
AnalysisDataService::Instance().remove(outName);
256259
}
257260

261+
GNU_DIAG_ON("dangling-reference")
262+
258263
private:
259264
Mantid::Algorithms::CalculateCarpenterSampleCorrection algorithm;
260265
};

Framework/Algorithms/test/CarpenterSampleCorrectionTest.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "MantidFrameworkTestHelpers/WorkspaceCreationHelper.h"
1919
#include "MantidHistogramData/LinearGenerator.h"
2020
#include "MantidIndexing/IndexInfo.h"
21+
#include "MantidKernel/WarningSuppressions.h"
2122

2223
using namespace Mantid;
2324
using namespace Mantid::API;
@@ -64,6 +65,8 @@ class CarpenterSampleCorrectionTest : public CxxTest::TestSuite {
6465
TS_ASSERT(dynamic_cast<PropertyWithValue<double> *>(props[5]));
6566
}
6667

68+
GNU_DIAG_OFF("dangling-reference")
69+
6770
void testCalculationHist() {
6871
using namespace Mantid::HistogramData;
6972
auto wksp = DataObjects::create<DataObjects::Workspace2D>(
@@ -154,6 +157,8 @@ class CarpenterSampleCorrectionTest : public CxxTest::TestSuite {
154157
TS_ASSERT_LESS_THAN(y_actual[i], 6.66480);
155158
}
156159

160+
GNU_DIAG_ON("dangling-reference")
161+
157162
// cleanup
158163
AnalysisDataService::Instance().remove(outName);
159164
}

Framework/Algorithms/test/FitPeaksTest.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "MantidFrameworkTestHelpers/WorkspaceCreationHelper.h"
2121
#include "MantidKernel/Logger.h"
2222
#include "MantidKernel/UnitFactory.h"
23+
#include "MantidKernel/WarningSuppressions.h"
2324

2425
using Mantid::Algorithms::FitPeaks;
2526

@@ -34,6 +35,8 @@ using Mantid::HistogramData::Counts;
3435
using Mantid::HistogramData::CountStandardDeviations;
3536
using Mantid::HistogramData::Points;
3637

38+
GNU_DIAG_OFF("dangling-reference")
39+
3740
namespace {
3841
/// static Logger definition
3942
Logger g_log("FitPeaksTest");

Framework/Algorithms/test/NormaliseToMonitorTest.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "MantidHistogramData/LinearGenerator.h"
2121
#include "MantidIndexing/IndexInfo.h"
2222
#include "MantidKernel/UnitFactory.h"
23+
#include "MantidKernel/WarningSuppressions.h"
2324

2425
using namespace Mantid;
2526
using namespace Mantid::Kernel;
@@ -404,6 +405,8 @@ class NormaliseToMonitorTest : public CxxTest::TestSuite {
404405
TS_ASSERT(alg.isExecuted())
405406
}
406407

408+
GNU_DIAG_OFF("dangling-reference")
409+
407410
void test_with_scanning_workspace_bin_by_bin() {
408411
auto testWS = makeTestDetectorScanWorkspace();
409412

@@ -504,6 +507,8 @@ class NormaliseToMonitorTest : public CxxTest::TestSuite {
504507
}
505508
}
506509

510+
GNU_DIAG_ON("dangling-reference")
511+
507512
private:
508513
MatrixWorkspace_sptr makeTestDetectorScanWorkspace() {
509514
const size_t N_DET = 10;

Framework/Beamline/src/ComponentInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ void ComponentInfo::doScaleComponent(const std::pair<size_t, size_t> &index, con
314314
const size_t offsetIndex = compOffsetIndex(subIndex);
315315
Eigen::Vector3d oldPos = position({subIndex, timeIndex});
316316
Eigen::Vector3d newPos = scalingMatrix * oldPos + (Eigen::Matrix3d::Identity() - scalingMatrix) * compPos;
317-
m_positions.access()[linearIndex({offsetIndex, timeIndex})] = newPos;
317+
m_positions.access()[linearIndex({offsetIndex, timeIndex})] = std::move(newPos);
318318
}
319319
}
320320

Framework/Crystal/src/SCDPanelErrors.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "MantidGeometry/Instrument.h"
1818
#include "MantidGeometry/Instrument/Component.h"
1919
#include "MantidGeometry/Instrument/RectangularDetector.h"
20+
#include "MantidKernel/DynamicPointerCastHelper.h"
2021
#include "MantidKernel/FileValidator.h"
2122
#include <algorithm>
2223
#include <boost/math/special_functions/round.hpp>
@@ -76,7 +77,9 @@ void SCDPanelErrors::moveDetector(double x, double y, double z, double rotx, dou
7677
if (detname.compare("none") == 0.0)
7778
return;
7879
// CORELLI has sixteenpack under bank
79-
DataObjects::PeaksWorkspace_sptr inputP = std::dynamic_pointer_cast<DataObjects::PeaksWorkspace>(inputW);
80+
DataObjects::PeaksWorkspace_sptr inputP =
81+
Kernel::DynamicPointerCastHelper::dynamicPointerCastWithCheck<DataObjects::PeaksWorkspace, API::Workspace>(
82+
inputW);
8083
Geometry::Instrument_sptr inst = std::const_pointer_cast<Geometry::Instrument>(inputP->getInstrument());
8184
if (inst->getName().compare("CORELLI") == 0.0 && detname != "moderator")
8285
detname.append("/sixteenpack");
@@ -175,15 +178,9 @@ void SCDPanelErrors::eval(double xshift, double yshift, double zshift, double xr
175178
std::shared_ptr<API::Workspace> cloned = m_workspace->clone();
176179
moveDetector(xshift, yshift, zshift, xrotate, yrotate, zrotate, scalex, scaley, m_bank, cloned);
177180

178-
auto inputP = std::dynamic_pointer_cast<DataObjects::PeaksWorkspace>(cloned);
179-
// IAlgorithm_sptr alg =
180-
// Mantid::API::AlgorithmFactory::Instance().create("IndexPeaks", -1);
181-
// alg->initialize();
182-
// alg->setChild(true);
183-
// alg->setLogging(false);
184-
// alg->setProperty("PeaksWorkspace", inputP);
185-
// alg->setProperty("Tolerance", 0.15);
186-
// alg->execute();
181+
auto inputP =
182+
Kernel::DynamicPointerCastHelper::dynamicPointerCastWithCheck<DataObjects::PeaksWorkspace, API::Workspace>(
183+
cloned);
187184
auto inst = inputP->getInstrument();
188185
Geometry::OrientedLattice lattice = inputP->mutableSample().getOrientedLattice();
189186
for (int i = 0; i < inputP->getNumberPeaks(); i++) {

0 commit comments

Comments
 (0)