Skip to content

Commit 81d147d

Browse files
committed
Fix two test failures with functions marked nodiscard.
With gcc-15, the dereferencing or the + operator of iterators are marked nodiscard. This makes two tests fail, because the warning leads to a non-zero diff.
1 parent 4a14ad3 commit 81d147d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cling/dict/runoperators.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ void runoperators() {
2323
std::vector<myiterator> v;
2424
std::vector<myiterator>::iterator iter;
2525
for( iter = v.begin(); iter != v.end(); ++iter) {
26-
iter + 1;
26+
static_cast<void>(iter + 1);
2727
}
2828
}

cling/stl/default/VectorSort.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int VectorSort() {
5353
// ensure that we can iterate, and that the precedence is correct,
5454
// and that the op++ doesn't operator on the elements:
5555
++beg++;
56-
*(++beg)++;
56+
static_cast<void>(*(++beg)++);
5757
++(*(++beg));
5858
beg = ++beg++;
5959
beg = ++beg++;

0 commit comments

Comments
 (0)