Skip to content

Commit

Permalink
Tidy up some clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
simondsmart committed Aug 28, 2023
1 parent de68dd7 commit ffdee81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/eckit/parser/YAMLParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

namespace eckit {

static Value toValue(const std::string& s);

struct YAMLItem : public Counted {

long indent_;
Expand Down
9 changes: 9 additions & 0 deletions tests/utils/test_optional.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,18 @@ CASE("copy and move assign") {
EXPECT(!opt3);

// Self move-assignement
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-move"
opt2 = std::move(opt2);
#pragma clang diagnostic pop
EXPECT(opt2);
EXPECT(opt2.value() == 2);

// Self copy-assignement
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
opt2 = opt2;
#pragma clang diagnostic pop
EXPECT(opt2);
EXPECT(opt2.value() == 2);

Expand Down Expand Up @@ -192,7 +198,10 @@ CASE("non-trivial object: std::string") {

// Test move assign to self
Optional<std::string> optTmp4("tmp4");
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-move"
optTmp4 = std::move(optTmp4);
#pragma clang diagnostic pop
EXPECT(optTmp4);
EXPECT_EQUAL(optTmp4.value(), std::string("tmp4"));

Expand Down

0 comments on commit ffdee81

Please sign in to comment.