Skip to content

Commit

Permalink
Fix two test failures with functions marked nodiscard.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hageboeck committed Feb 13, 2025
1 parent 7a6bcde commit 98b2a03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cling/dict/runoperators.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ void runoperators() {
std::vector<myiterator> v;
std::vector<myiterator>::iterator iter;
for( iter = v.begin(); iter != v.end(); ++iter) {
iter + 1;
static_cast<void>(= iter + 1);
}
}
2 changes: 1 addition & 1 deletion cling/stl/default/VectorSort.C
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int VectorSort() {
// ensure that we can iterate, and that the precedence is correct,
// and that the op++ doesn't operator on the elements:
++beg++;
*(++beg)++;
static_cast<void>(*(++beg)++);
++(*(++beg));
beg = ++beg++;
beg = ++beg++;
Expand Down

0 comments on commit 98b2a03

Please sign in to comment.