Skip to content

Commit

Permalink
Fix latent clang-tidy errors
Browse files Browse the repository at this point in the history
Removes two defaulted and implicitly deleted assignment
operators in the MPD client. Also fixes `Die` utility to
enable compile-time checking of format parameters.
  • Loading branch information
joshkunz committed Apr 25, 2020
1 parent f604b89 commit f7887cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/mpd_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class SongImpl : public Song {

// However, moves are OK, because the "old" owner no longer exists.
SongImpl(SongImpl&&) = default;
SongImpl& operator=(SongImpl&&) = default;

// Free the wrapped struct mpd_song;
~SongImpl() override;
Expand Down Expand Up @@ -178,7 +177,6 @@ class SongReaderImpl : public SongReader {

// As with the other types, moves are OK.
SongReaderImpl(SongReaderImpl&&) = default;
SongReaderImpl& operator=(SongReaderImpl&&) = default;

// Default destructor should work fine, since the std::optional owns
// a unique_ptr to an actual Song. The generated destructor will destruct
Expand Down
4 changes: 2 additions & 2 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace {
// Die logs the given message as if it was printed via `absl::StrFormat`,
// and then terminates the program with with an error status code.
template <typename... Args>
void Die(Args... strs) {
std::cerr << absl::StrFormat(strs...) << std::endl;
void Die(absl::FormatSpec<Args...> format, Args... vars) {
std::cerr << absl::StrFormat(format, vars...) << std::endl;
std::exit(EXIT_FAILURE);
}

Expand Down

0 comments on commit f7887cb

Please sign in to comment.