Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy fixes #1397

Merged
merged 9 commits into from
Nov 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[clang-tidy] Add noexcept where move is used
Found with performance-noexcept-move-constructor

Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb committed Nov 7, 2019
commit c8db53b3b0ff8b1c2aec1d6a89c6c4971ec2c912
4 changes: 2 additions & 2 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
@@ -607,14 +607,14 @@ class basic_memory_buffer : private Allocator, public internal::buffer<T> {
of the other object to it.
\endrst
*/
basic_memory_buffer(basic_memory_buffer&& other) { move(other); }
basic_memory_buffer(basic_memory_buffer&& other) FMT_NOEXCEPT { move(other); }

/**
\rst
Moves the content of the other ``basic_memory_buffer`` object to this one.
\endrst
*/
basic_memory_buffer& operator=(basic_memory_buffer&& other) {
basic_memory_buffer& operator=(basic_memory_buffer&& other) FMT_NOEXCEPT {
assert(this != &other);
deallocate();
move(other);
4 changes: 2 additions & 2 deletions include/fmt/posix.h
Original file line number Diff line number Diff line change
@@ -146,7 +146,7 @@ class buffered_file {
other.file_ = nullptr;
}

buffered_file& operator=(buffered_file&& other) {
buffered_file& operator=(buffered_file&& other) FMT_NOEXCEPT {
close();
file_ = other.file_;
other.file_ = nullptr;
@@ -209,7 +209,7 @@ class file {

file(file&& other) FMT_NOEXCEPT : fd_(other.fd_) { other.fd_ = -1; }

file& operator=(file&& other) {
file& operator=(file&& other) FMT_NOEXCEPT {
close();
fd_ = other.fd_;
other.fd_ = -1;