Skip to content
Snippets Groups Projects
Commit 03297901 authored by Martyn Gigg's avatar Martyn Gigg Committed by GitHub
Browse files

Merge pull request #20507 from mantidproject/gcc7_warnings

Get rid of unused arg warnings in gcc7
parents 08129e79 35c9b7b0
No related merge requests found
Showing
with 75 additions and 205 deletions
......@@ -467,7 +467,7 @@ public:
mappings.emplace(1, std::set<Mantid::detid_t>{2});
expt.cacheDetectorGroupings(mappings);
size_t index;
size_t index{0};
TS_ASSERT_THROWS_NOTHING(index = expt.groupOfDetectorID(1));
TS_ASSERT_EQUALS(index, 0);
}
......
......@@ -18,20 +18,14 @@ public:
void test_has_correct_mixins() {
BinEdges data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(
(dynamic_cast<detail::VectorOf<BinEdges, HistogramX> &>(data))));
TS_ASSERT_THROWS_NOTHING(
(dynamic_cast<detail::VectorOf<BinEdges, HistogramX> &>(data)));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Iterable<BinEdges> &>(data));
UNUSED_ARG(dynamic_cast<detail::Iterable<BinEdges> &>(data)));
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::Offsetable<BinEdges> &>(data));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Scalable<BinEdges> &>(data));
#if __clang__
#pragma clang diagnostic pop
#endif
UNUSED_ARG(dynamic_cast<detail::Offsetable<BinEdges> &>(data)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Scalable<BinEdges> &>(data)));
}
void test_default_constructor() {
......
......@@ -23,16 +23,9 @@ public:
void test_has_correct_mixins() {
CountStandardDeviations data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING((dynamic_cast<detail::StandardDeviationVectorOf<
CountStandardDeviations, HistogramE, CountVariances> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG((dynamic_cast<detail::StandardDeviationVectorOf<
CountStandardDeviations, HistogramE, CountVariances> &>(data))));
}
void test_construct_default() {
......
......@@ -21,16 +21,8 @@ public:
void test_has_correct_mixins() {
CountVariances data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING((dynamic_cast<detail::VarianceVectorOf<
CountVariances, HistogramE, CountStandardDeviations> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG((dynamic_cast<detail::VarianceVectorOf<
CountVariances, HistogramE, CountStandardDeviations> &>(data))));
}
void test_construct_default() {
......
......@@ -19,20 +19,16 @@ public:
void test_has_correct_mixins() {
Counts data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(
(dynamic_cast<detail::VectorOf<Counts, HistogramY> &>(data))));
TS_ASSERT_THROWS_NOTHING(
(dynamic_cast<detail::VectorOf<Counts, HistogramY> &>(data)));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Addable<Counts> &>(data));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Iterable<Counts> &>(data));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Offsetable<Counts> &>(data));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Scalable<Counts> &>(data));
#if __clang__
#pragma clang diagnostic pop
#endif
UNUSED_ARG(dynamic_cast<detail::Addable<Counts> &>(data)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Iterable<Counts> &>(data)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Offsetable<Counts> &>(data)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Scalable<Counts> &>(data)));
}
void test_construct_default() {
......
......@@ -19,24 +19,16 @@ public:
void test_has_correct_mixins() {
Frequencies data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(
(dynamic_cast<detail::VectorOf<Frequencies, HistogramY> &>(data))));
TS_ASSERT_THROWS_NOTHING(
(dynamic_cast<detail::VectorOf<Frequencies, HistogramY> &>(data)));
UNUSED_ARG(dynamic_cast<detail::Addable<Frequencies> &>(data)));
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::Addable<Frequencies> &>(data));
UNUSED_ARG(dynamic_cast<detail::Iterable<Frequencies> &>(data)));
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::Iterable<Frequencies> &>(data));
UNUSED_ARG(dynamic_cast<detail::Offsetable<Frequencies> &>(data)));
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::Offsetable<Frequencies> &>(data));
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::Scalable<Frequencies> &>(data));
#if __clang__
#pragma clang diagnostic pop
#endif
UNUSED_ARG(dynamic_cast<detail::Scalable<Frequencies> &>(data)));
}
void test_construct_default() {
......
......@@ -25,16 +25,10 @@ public:
void test_has_correct_mixins() {
FrequencyStandardDeviations data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING((dynamic_cast<detail::StandardDeviationVectorOf<
FrequencyStandardDeviations, HistogramE, FrequencyVariances> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG((dynamic_cast<detail::StandardDeviationVectorOf<
FrequencyStandardDeviations, HistogramE, FrequencyVariances> &>(
data))));
}
void test_construct_default() {
......
......@@ -23,16 +23,10 @@ public:
void test_has_correct_mixins() {
FrequencyVariances data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING((dynamic_cast<detail::VarianceVectorOf<
FrequencyVariances, HistogramE, FrequencyStandardDeviations> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(
(dynamic_cast<detail::VarianceVectorOf<FrequencyVariances, HistogramE,
FrequencyStandardDeviations> &>(
data))));
}
void test_construct_default() {
......
......@@ -23,16 +23,8 @@ public:
void test_has_correct_mixins() {
HistogramDx dx;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::FixedLengthVector<HistogramDx> &>(dx));
#if __clang__
#pragma clang diagnostic pop
#endif
UNUSED_ARG(dynamic_cast<detail::FixedLengthVector<HistogramDx> &>(dx)));
}
};
......
......@@ -24,18 +24,12 @@ public:
void test_has_correct_mixins() {
HistogramE e;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::FixedLengthVector<HistogramE> &>(e));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Addable<HistogramE> &>(e));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Scalable<HistogramE> &>(e));
#if __clang__
#pragma clang diagnostic pop
#endif
UNUSED_ARG(dynamic_cast<detail::FixedLengthVector<HistogramE> &>(e)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Addable<HistogramE> &>(e)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Scalable<HistogramE> &>(e)));
}
};
......
......@@ -25,18 +25,12 @@ public:
void test_has_correct_mixins() {
HistogramX x;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::FixedLengthVector<HistogramX> &>(x));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Offsetable<HistogramX> &>(x));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Scalable<HistogramX> &>(x));
#if __clang__
#pragma clang diagnostic pop
#endif
UNUSED_ARG(dynamic_cast<detail::FixedLengthVector<HistogramX> &>(x)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Offsetable<HistogramX> &>(x)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Scalable<HistogramX> &>(x)));
}
};
......
......@@ -27,21 +27,16 @@ public:
void test_has_correct_mixins() {
HistogramY y;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::FixedLengthVector<HistogramY> &>(y));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Addable<HistogramY> &>(y));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Offsetable<HistogramY> &>(y));
UNUSED_ARG(dynamic_cast<detail::FixedLengthVector<HistogramY> &>(y)));
TS_ASSERT_THROWS_NOTHING(
dynamic_cast<detail::Multipliable<HistogramY> &>(y));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Scalable<HistogramY> &>(y));
#if __clang__
#pragma clang diagnostic pop
#endif
UNUSED_ARG(dynamic_cast<detail::Addable<HistogramY> &>(y)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Offsetable<HistogramY> &>(y)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Multipliable<HistogramY> &>(y)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Scalable<HistogramY> &>(y)));
}
};
......
......@@ -19,16 +19,9 @@ public:
void test_has_correct_mixins() {
PointStandardDeviations data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING((dynamic_cast<detail::StandardDeviationVectorOf<
PointStandardDeviations, HistogramDx, PointVariances> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG((dynamic_cast<detail::StandardDeviationVectorOf<
PointStandardDeviations, HistogramDx, PointVariances> &>(data))));
}
void test_construct_default() {
......
......@@ -18,16 +18,8 @@ public:
void test_has_correct_mixins() {
PointVariances data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING((dynamic_cast<detail::VarianceVectorOf<
PointVariances, HistogramDx, PointStandardDeviations> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG((dynamic_cast<detail::VarianceVectorOf<
PointVariances, HistogramDx, PointStandardDeviations> &>(data))));
}
void test_construct_default() {
......
......@@ -18,19 +18,14 @@ public:
void test_has_correct_mixins() {
Points data;
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(
(dynamic_cast<detail::VectorOf<Points, HistogramX> &>(data))));
TS_ASSERT_THROWS_NOTHING(
(dynamic_cast<detail::VectorOf<Points, HistogramX> &>(data)));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Iterable<Points> &>(data));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Offsetable<Points> &>(data));
TS_ASSERT_THROWS_NOTHING(dynamic_cast<detail::Scalable<Points> &>(data));
#if __clang__
#pragma clang diagnostic pop
#endif
UNUSED_ARG(dynamic_cast<detail::Iterable<Points> &>(data)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Offsetable<Points> &>(data)));
TS_ASSERT_THROWS_NOTHING(
UNUSED_ARG(dynamic_cast<detail::Scalable<Points> &>(data)));
}
void test_construct_default() {
......
......@@ -17,16 +17,8 @@ public:
void test_has_correct_mixins() {
DetectorID data(0);
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(
(dynamic_cast<detail::IndexType<DetectorID, int32_t> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(
(dynamic_cast<detail::IndexType<DetectorID, int32_t> &>(data))));
}
};
......
......@@ -19,16 +19,8 @@ public:
void test_has_correct_mixins() {
GlobalSpectrumIndex data(0);
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(
(dynamic_cast<detail::IndexType<GlobalSpectrumIndex, size_t> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG((
dynamic_cast<detail::IndexType<GlobalSpectrumIndex, size_t> &>(data))));
}
};
......
......@@ -17,16 +17,8 @@ public:
void test_has_correct_mixins() {
PartitionIndex data(0);
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(
(dynamic_cast<detail::IndexType<PartitionIndex, int> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(
(dynamic_cast<detail::IndexType<PartitionIndex, int> &>(data))));
}
};
......
......@@ -19,16 +19,8 @@ public:
void test_has_correct_mixins() {
SpectrumIndexSet data(0);
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(
(dynamic_cast<detail::IndexSet<SpectrumIndexSet> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
UNUSED_ARG((dynamic_cast<detail::IndexSet<SpectrumIndexSet> &>(data))));
}
};
......
......@@ -17,16 +17,8 @@ public:
void test_has_correct_mixins() {
SpectrumNumber data(0);
// AppleClang gives warning if the result is unused.
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"
#endif
TS_ASSERT_THROWS_NOTHING(
(dynamic_cast<detail::IndexType<SpectrumNumber, int32_t> &>(data)));
#if __clang__
#pragma clang diagnostic pop
#endif
TS_ASSERT_THROWS_NOTHING(UNUSED_ARG(
(dynamic_cast<detail::IndexType<SpectrumNumber, int32_t> &>(data))));
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment