clang-tidy check performance-noexcept-move-constructor fix

This commit is contained in:
Maksim Kita 2022-02-25 19:04:48 +00:00
parent f893002b69
commit 1f5837359e
56 changed files with 124 additions and 105 deletions

View File

@ -34,7 +34,7 @@ Checks: '-*,
performance-trivially-destructible,
performance-unnecessary-copy-initialization,
performance-noexcept-move-constructor,
performance-move-const-arg,
# performance-move-const-arg,
readability-avoid-const-params-in-decls,
readability-const-return-type,
@ -208,3 +208,5 @@ CheckOptions:
value: CamelCase
- key: modernize-loop-convert.UseCxx20ReverseRanges
value: false
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: false

View File

@ -909,7 +909,7 @@ public:
ColumnPtr new_nested_column = nested_model->generate(nested_column);
return ColumnArray::create(IColumn::mutate(std::move(new_nested_column)), IColumn::mutate(std::move(column_array.getOffsetsPtr())));
return ColumnArray::create(IColumn::mutate(std::move(new_nested_column)), IColumn::mutate(column_array.getOffsetsPtr()));
}
void updateSeed() override
@ -947,7 +947,7 @@ public:
ColumnPtr new_nested_column = nested_model->generate(nested_column);
return ColumnNullable::create(IColumn::mutate(std::move(new_nested_column)), IColumn::mutate(std::move(column_nullable.getNullMapColumnPtr())));
return ColumnNullable::create(IColumn::mutate(std::move(new_nested_column)), IColumn::mutate(column_nullable.getNullMapColumnPtr()));
}
void updateSeed() override

View File

@ -706,8 +706,8 @@ private:
AccessRights::AccessRights() = default;
AccessRights::~AccessRights() = default;
AccessRights::AccessRights(AccessRights && src) = default;
AccessRights & AccessRights::operator =(AccessRights && src) = default;
AccessRights::AccessRights(AccessRights && src) noexcept = default;
AccessRights & AccessRights::operator =(AccessRights && src) noexcept = default;
AccessRights::AccessRights(const AccessRights & src)

View File

@ -19,8 +19,8 @@ public:
~AccessRights();
AccessRights(const AccessRights & src);
AccessRights & operator =(const AccessRights & src);
AccessRights(AccessRights && src);
AccessRights & operator =(AccessRights && src);
AccessRights(AccessRights && src) noexcept;
AccessRights & operator =(AccessRights && src) noexcept;
bool isEmpty() const;

View File

@ -208,7 +208,7 @@ void LDAPAccessStorage::assignRolesNoLock(User & user, const LDAPClient::SearchR
{
const auto & user_name = user.getName();
auto & granted_roles = user.granted_roles;
const auto local_role_names = mapExternalRolesNoLock(external_roles);
auto local_role_names = mapExternalRolesNoLock(external_roles);
auto grant_role = [this, &user_name, &granted_roles] (const String & role_name, const bool common)
{

View File

@ -22,8 +22,8 @@ namespace ErrorCodes
RolesOrUsersSet::RolesOrUsersSet() = default;
RolesOrUsersSet::RolesOrUsersSet(const RolesOrUsersSet & src) = default;
RolesOrUsersSet & RolesOrUsersSet::operator =(const RolesOrUsersSet & src) = default;
RolesOrUsersSet::RolesOrUsersSet(RolesOrUsersSet && src) = default;
RolesOrUsersSet & RolesOrUsersSet::operator =(RolesOrUsersSet && src) = default;
RolesOrUsersSet::RolesOrUsersSet(RolesOrUsersSet && src) noexcept = default;
RolesOrUsersSet & RolesOrUsersSet::operator =(RolesOrUsersSet && src) noexcept = default;
RolesOrUsersSet::RolesOrUsersSet(AllTag)

View File

@ -22,8 +22,8 @@ struct RolesOrUsersSet
RolesOrUsersSet();
RolesOrUsersSet(const RolesOrUsersSet & src);
RolesOrUsersSet & operator =(const RolesOrUsersSet & src);
RolesOrUsersSet(RolesOrUsersSet && src);
RolesOrUsersSet & operator =(RolesOrUsersSet && src);
RolesOrUsersSet(RolesOrUsersSet && src) noexcept;
RolesOrUsersSet & operator =(RolesOrUsersSet && src) noexcept;
struct AllTag {};
RolesOrUsersSet(AllTag);

View File

@ -25,8 +25,8 @@ SettingsConstraints::SettingsConstraints(const AccessControl & access_control_)
SettingsConstraints::SettingsConstraints(const SettingsConstraints & src) = default;
SettingsConstraints & SettingsConstraints::operator=(const SettingsConstraints & src) = default;
SettingsConstraints::SettingsConstraints(SettingsConstraints && src) = default;
SettingsConstraints & SettingsConstraints::operator=(SettingsConstraints && src) = default;
SettingsConstraints::SettingsConstraints(SettingsConstraints && src) noexcept = default;
SettingsConstraints & SettingsConstraints::operator=(SettingsConstraints && src) noexcept = default;
SettingsConstraints::~SettingsConstraints() = default;

View File

@ -53,9 +53,9 @@ class SettingsConstraints
public:
SettingsConstraints(const AccessControl & access_control_);
SettingsConstraints(const SettingsConstraints & src);
SettingsConstraints & operator =(const SettingsConstraints & src);
SettingsConstraints(SettingsConstraints && src);
SettingsConstraints & operator =(SettingsConstraints && src);
SettingsConstraints & operator=(const SettingsConstraints & src);
SettingsConstraints(SettingsConstraints && src) noexcept;
SettingsConstraints & operator=(SettingsConstraints && src) noexcept;
~SettingsConstraints();
void clear();

View File

@ -147,7 +147,7 @@ void BackupImpl::readBackupMetadata()
auto in = readFileImpl(".backup");
String str;
readStringUntilEOF(str, *in);
std::istringstream stream(std::move(str)); // STYLE_CHECK_ALLOW_STD_STRING_STREAM
std::istringstream stream(str); // STYLE_CHECK_ALLOW_STD_STRING_STREAM
Poco::AutoPtr<Poco::Util::XMLConfiguration> config{new Poco::Util::XMLConfiguration()};
config->load(stream);

View File

@ -11,12 +11,12 @@ ActionLock::ActionLock(const ActionBlocker & blocker) : counter_ptr(blocker.coun
++(*counter);
}
ActionLock::ActionLock(ActionLock && other)
ActionLock::ActionLock(ActionLock && other) noexcept
{
*this = std::move(other);
}
ActionLock & ActionLock::operator=(ActionLock && other)
ActionLock & ActionLock::operator=(ActionLock && other) noexcept
{
auto lock_lhs = this->counter_ptr.lock();

View File

@ -19,8 +19,8 @@ public:
explicit ActionLock(const ActionBlocker & blocker);
ActionLock(ActionLock && other);
ActionLock & operator=(ActionLock && other);
ActionLock(ActionLock && other) noexcept;
ActionLock & operator=(ActionLock && other) noexcept;
ActionLock(const ActionLock & other) = delete;
ActionLock & operator=(const ActionLock & other) = delete;

View File

@ -120,6 +120,11 @@ public:
return emplaceImpl(milliseconds, x);
}
[[nodiscard]] bool tryPush(T && x, UInt64 milliseconds = 0)
{
return emplaceImpl(milliseconds, std::move(x));
}
/// Returns false if queue is finished or object was not emplaced during timeout
template <typename... Args>
[[nodiscard]] bool tryEmplace(UInt64 milliseconds, Args &&... args)

View File

@ -21,12 +21,12 @@ Epoll::Epoll() : events_count(0)
throwFromErrno("Cannot open epoll descriptor", DB::ErrorCodes::EPOLL_ERROR);
}
Epoll::Epoll(Epoll && other) : epoll_fd(other.epoll_fd), events_count(other.events_count.load())
Epoll::Epoll(Epoll && other) noexcept : epoll_fd(other.epoll_fd), events_count(other.events_count.load())
{
other.epoll_fd = -1;
}
Epoll & Epoll::operator=(Epoll && other)
Epoll & Epoll::operator=(Epoll && other) noexcept
{
epoll_fd = other.epoll_fd;
other.epoll_fd = -1;

View File

@ -19,8 +19,8 @@ public:
Epoll(const Epoll &) = delete;
Epoll & operator=(const Epoll &) = delete;
Epoll & operator=(Epoll && other);
Epoll(Epoll && other);
Epoll & operator=(Epoll && other) noexcept;
Epoll(Epoll && other) noexcept;
/// Add new file descriptor to epoll. If ptr set to nullptr, epoll_event.data.fd = fd,
/// otherwise epoll_event.data.ptr = ptr.

View File

@ -27,7 +27,7 @@ TimerDescriptor::TimerDescriptor(int clockid, int flags)
throwFromErrno("Cannot set O_NONBLOCK for timer_fd", ErrorCodes::CANNOT_FCNTL);
}
TimerDescriptor::TimerDescriptor(TimerDescriptor && other) : timer_fd(other.timer_fd)
TimerDescriptor::TimerDescriptor(TimerDescriptor && other) noexcept : timer_fd(other.timer_fd)
{
other.timer_fd = -1;
}

View File

@ -17,7 +17,7 @@ public:
TimerDescriptor(const TimerDescriptor &) = delete;
TimerDescriptor & operator=(const TimerDescriptor &) = delete;
TimerDescriptor(TimerDescriptor && other);
TimerDescriptor(TimerDescriptor && other) noexcept;
TimerDescriptor & operator=(TimerDescriptor &&) = default;
int getDescriptor() const { return timer_fd; }

View File

@ -52,7 +52,7 @@ private:
{
std::cerr << "Mutating\n";
auto res = shallowMutate();
res->wrapped = IColumn::mutate(std::move(wrapped));
res->wrapped = IColumn::mutate(wrapped);
return res;
}

View File

@ -24,12 +24,12 @@ namespace ErrorCodes
}
MySQLClient::MySQLClient(const String & host_, UInt16 port_, const String & user_, const String & password_)
: host(host_), port(port_), user(user_), password(std::move(password_)),
: host(host_), port(port_), user(user_), password(password_),
client_capabilities(CLIENT_PROTOCOL_41 | CLIENT_PLUGIN_AUTH | CLIENT_SECURE_CONNECTION)
{
}
MySQLClient::MySQLClient(MySQLClient && other)
MySQLClient::MySQLClient(MySQLClient && other) noexcept
: host(std::move(other.host)), port(other.port), user(std::move(other.user)), password(std::move(other.password))
, client_capabilities(other.client_capabilities)
{

View File

@ -22,7 +22,7 @@ class MySQLClient
{
public:
MySQLClient(const String & host_, UInt16 port_, const String & user_, const String & password_);
MySQLClient(MySQLClient && other);
MySQLClient(MySQLClient && other) noexcept;
void connect();
void disconnect();

View File

@ -99,8 +99,8 @@ HandshakeResponse::HandshakeResponse() : capability_flags(0x00), max_packet_size
HandshakeResponse::HandshakeResponse(
UInt32 capability_flags_, UInt32 max_packet_size_, UInt8 character_set_, const String & username_, const String & database_,
const String & auth_response_, const String & auth_plugin_name_)
: capability_flags(capability_flags_), max_packet_size(max_packet_size_), character_set(character_set_), username(std::move(username_)),
database(std::move(database_)), auth_response(std::move(auth_response_)), auth_plugin_name(std::move(auth_plugin_name_))
: capability_flags(capability_flags_), max_packet_size(max_packet_size_), character_set(character_set_), username(username_),
database(database_), auth_response(auth_response_), auth_plugin_name(auth_plugin_name_)
{
}

View File

@ -84,7 +84,7 @@ struct Task
std::cout << " Task " << tag << std::endl;
}
Task(Task &) = delete;
Task(Task &&rhs) : my(rhs.my), tag(rhs.tag)
Task(Task &&rhs) noexcept : my(rhs.my), tag(rhs.tag)
{
rhs.my = {};
std::cout << " Task&& " << tag << std::endl;

View File

@ -181,10 +181,10 @@ void SerializationInfoByName::writeJSON(WriteBuffer & out) const
{
auto info_json = info->toJSON();
info_json.set(KEY_NAME, name);
column_infos.add(std::move(info_json));
column_infos.add(std::move(info_json)); /// NOLINT
}
object.set(KEY_COLUMNS, std::move(column_infos));
object.set(KEY_COLUMNS, std::move(column_infos)); /// NOLINT
std::ostringstream oss; // STYLE_CHECK_ALLOW_STD_STRING_STREAM
oss.exceptions(std::ios::failbit);

View File

@ -33,8 +33,8 @@ namespace
DictionaryTypedSpecialAttribute makeDictionaryTypedSpecialAttribute(
const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix, const std::string & default_type)
{
const auto name = config.getString(config_prefix + ".name", "");
const auto expression = config.getString(config_prefix + ".expression", "");
auto name = config.getString(config_prefix + ".name", "");
auto expression = config.getString(config_prefix + ".expression", "");
if (name.empty() && !expression.empty())
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Element {}.name is empty");

View File

@ -611,7 +611,7 @@ template <typename Impl, typename Name>
ColumnPtr FunctionAnyArityLogical<Impl, Name>::executeImpl(
const ColumnsWithTypeAndName & args, const DataTypePtr & result_type, size_t input_rows_count) const
{
ColumnsWithTypeAndName arguments = std::move(args);
ColumnsWithTypeAndName arguments = args;
/// Special implementation for short-circuit arguments.
if (checkShortCircuitArguments(arguments) != -1)

View File

@ -55,12 +55,12 @@ AIOContext::~AIOContext()
io_destroy(ctx);
}
AIOContext::AIOContext(AIOContext && rhs)
AIOContext::AIOContext(AIOContext && rhs) noexcept
{
*this = std::move(rhs);
}
AIOContext & AIOContext::operator=(AIOContext && rhs)
AIOContext & AIOContext::operator=(AIOContext && rhs) noexcept
{
std::swap(ctx, rhs.ctx);
return *this;

View File

@ -38,8 +38,8 @@ struct AIOContext : private boost::noncopyable
AIOContext() {}
AIOContext(unsigned int nr_events);
~AIOContext();
AIOContext(AIOContext && rhs);
AIOContext & operator=(AIOContext && rhs);
AIOContext(AIOContext && rhs) noexcept;
AIOContext & operator=(AIOContext && rhs) noexcept;
};
#elif defined(OS_FREEBSD)

View File

@ -42,12 +42,12 @@ public:
}
}
HandleHolder(HandleHolder && src)
HandleHolder(HandleHolder && src) noexcept
{
*this = std::move(src);
}
HandleHolder & operator =(HandleHolder && src)
HandleHolder & operator=(HandleHolder && src) noexcept
{
reader = std::exchange(src.reader, nullptr);
raw_handle = std::exchange(src.raw_handle, nullptr);

View File

@ -46,12 +46,12 @@ public:
}
}
HandleHolder(HandleHolder && src)
HandleHolder(HandleHolder && src) noexcept
{
*this = std::move(src);
}
HandleHolder & operator =(HandleHolder && src)
HandleHolder & operator=(HandleHolder && src) noexcept
{
writer = std::exchange(src.writer, nullptr);
raw_handle = std::exchange(src.raw_handle, nullptr);

View File

@ -65,7 +65,13 @@ CompressionMethod chooseCompressionMethod(const std::string & path, const std::s
file_extension = path.substr(pos + 1, std::string::npos);
}
std::string method_str = file_extension.empty() ? hint : std::move(file_extension);
std::string method_str;
if (file_extension.empty())
method_str = hint;
else
method_str = std::move(file_extension);
boost::algorithm::to_lower(method_str);
if (method_str == "gzip" || method_str == "gz")

View File

@ -126,7 +126,7 @@ ProgressValues Progress::fetchAndResetPiecewiseAtomically()
return res;
}
Progress & Progress::operator=(Progress && other)
Progress & Progress::operator=(Progress && other) noexcept
{
read_rows = other.read_rows.load(std::memory_order_relaxed);
read_bytes = other.read_bytes.load(std::memory_order_relaxed);

View File

@ -111,9 +111,9 @@ struct Progress
ProgressValues fetchAndResetPiecewiseAtomically();
Progress & operator=(Progress && other);
Progress & operator=(Progress && other) noexcept;
Progress(Progress && other)
Progress(Progress && other) noexcept
{
*this = std::move(other);
}

View File

@ -413,7 +413,7 @@ void WriteBufferFromS3::waitForAllBackGroundTasks()
{
auto & task = upload_object_tasks.front();
if (task.exception)
std::rethrow_exception(std::move(task.exception));
std::rethrow_exception(task.exception);
part_tags.push_back(task.tag);
@ -424,7 +424,7 @@ void WriteBufferFromS3::waitForAllBackGroundTasks()
{
bg_tasks_condvar.wait(lock, [this]() { return put_object_task->is_finised; });
if (put_object_task->exception)
std::rethrow_exception(std::move(put_object_task->exception));
std::rethrow_exception(put_object_task->exception);
}
}
}

View File

@ -391,7 +391,7 @@ SetPtr makeExplicitSet(
ScopeStack::Level::~Level() = default;
ScopeStack::Level::Level() = default;
ScopeStack::Level::Level(Level &&) = default;
ScopeStack::Level::Level(Level &&) noexcept = default;
class ScopeStack::Index
{

View File

@ -72,7 +72,7 @@ struct ScopeStack : WithContext
NameSet inputs;
Level();
Level(Level &&);
Level(Level &&) noexcept;
~Level();
};

View File

@ -103,13 +103,13 @@ TemporaryTableHolder::TemporaryTableHolder(
{
}
TemporaryTableHolder::TemporaryTableHolder(TemporaryTableHolder && rhs)
TemporaryTableHolder::TemporaryTableHolder(TemporaryTableHolder && rhs) noexcept
: WithContext(rhs.context), temporary_tables(rhs.temporary_tables), id(rhs.id)
{
rhs.id = UUIDHelpers::Nil;
}
TemporaryTableHolder & TemporaryTableHolder::operator = (TemporaryTableHolder && rhs)
TemporaryTableHolder & TemporaryTableHolder::operator=(TemporaryTableHolder && rhs) noexcept
{
id = rhs.id;
rhs.id = UUIDHelpers::Nil;

View File

@ -98,8 +98,8 @@ struct TemporaryTableHolder : boost::noncopyable, WithContext
const ASTPtr & query = {},
bool create_for_global_subquery = false);
TemporaryTableHolder(TemporaryTableHolder && rhs);
TemporaryTableHolder & operator = (TemporaryTableHolder && rhs);
TemporaryTableHolder(TemporaryTableHolder && rhs) noexcept;
TemporaryTableHolder & operator=(TemporaryTableHolder && rhs) noexcept;
~TemporaryTableHolder();

View File

@ -7,7 +7,7 @@ namespace DB
SubqueryForSet::SubqueryForSet() = default;
SubqueryForSet::~SubqueryForSet() = default;
SubqueryForSet::SubqueryForSet(SubqueryForSet &&) = default;
SubqueryForSet & SubqueryForSet::operator= (SubqueryForSet &&) = default;
SubqueryForSet::SubqueryForSet(SubqueryForSet &&) noexcept = default;
SubqueryForSet & SubqueryForSet::operator= (SubqueryForSet &&) noexcept = default;
}

View File

@ -17,8 +17,8 @@ struct SubqueryForSet
{
SubqueryForSet();
~SubqueryForSet();
SubqueryForSet(SubqueryForSet &&);
SubqueryForSet & operator= (SubqueryForSet &&);
SubqueryForSet(SubqueryForSet &&) noexcept;
SubqueryForSet & operator=(SubqueryForSet &&) noexcept;
/// The source is obtained using the InterpreterSelectQuery subquery.
std::unique_ptr<QueryPlan> source;

View File

@ -6,7 +6,7 @@
#include <Parsers/ASTLiteral.h>
#include <Parsers/CommonParsers.h>
#include <Parsers/ExpressionElementParsers.h>
#include <boost/range/algorithm_ext/push_back.hpp>
#include <base/insertAtEnd.h>
namespace DB
@ -37,7 +37,7 @@ namespace
if (!elements_p.parse(pos, new_settings_ast, expected))
return false;
settings = std::move(new_settings_ast->as<const ASTSettingsProfileElements &>().elements);
settings = std::move(new_settings_ast->as<ASTSettingsProfileElements &>().elements);
return true;
});
}
@ -102,7 +102,8 @@ bool ParserCreateRoleQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expec
{
if (!settings)
settings = std::make_shared<ASTSettingsProfileElements>();
boost::range::push_back(settings->elements, std::move(new_settings));
insertAtEnd(settings->elements, std::move(new_settings));
continue;
}

View File

@ -11,7 +11,7 @@
#include <Access/Common/RowPolicyDefs.h>
#include <base/range.h>
#include <boost/container/flat_set.hpp>
#include <boost/range/algorithm_ext/push_back.hpp>
#include <base/insertAtEnd.h>
namespace DB
@ -264,7 +264,7 @@ bool ParserCreateRowPolicyQuery::parseImpl(Pos & pos, ASTPtr & node, Expected &
std::vector<std::pair<RowPolicyFilterType, ASTPtr>> new_filters;
if (parseForClauses(pos, expected, alter, new_filters))
{
boost::range::push_back(filters, std::move(new_filters));
insertAtEnd(filters, std::move(new_filters));
continue;
}

View File

@ -8,7 +8,7 @@
#include <Parsers/CommonParsers.h>
#include <Parsers/ExpressionElementParsers.h>
#include <Parsers/parseIdentifierOrStringLiteral.h>
#include <boost/range/algorithm_ext/push_back.hpp>
#include <base/insertAtEnd.h>
namespace DB
@ -39,7 +39,7 @@ namespace
if (!elements_p.parse(pos, new_settings_ast, expected))
return false;
settings = std::move(new_settings_ast->as<const ASTSettingsProfileElements &>().elements);
settings = std::move(new_settings_ast->as<ASTSettingsProfileElements &>().elements);
return true;
});
}
@ -122,7 +122,8 @@ bool ParserCreateSettingsProfileQuery::parseImpl(Pos & pos, ASTPtr & node, Expec
{
if (!settings)
settings = std::make_shared<ASTSettingsProfileElements>();
boost::range::push_back(settings->elements, std::move(new_settings));
insertAtEnd(settings->elements, std::move(new_settings));
continue;
}

View File

@ -15,7 +15,7 @@
#include <Parsers/parseIdentifierOrStringLiteral.h>
#include <base/range.h>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/range/algorithm_ext/push_back.hpp>
#include <base/insertAtEnd.h>
namespace DB
@ -250,7 +250,7 @@ namespace
if (!parseHostsWithoutPrefix(pos, expected, res_hosts))
return false;
hosts.add(std::move(res_hosts));
hosts.add(res_hosts);
return true;
});
}
@ -289,7 +289,7 @@ namespace
if (!elements_p.parse(pos, new_settings_ast, expected))
return false;
settings = std::move(new_settings_ast->as<const ASTSettingsProfileElements &>().elements);
settings = std::move(new_settings_ast->as<ASTSettingsProfileElements &>().elements);
return true;
});
}
@ -414,7 +414,8 @@ bool ParserCreateUserQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expec
{
if (!settings)
settings = std::make_shared<ASTSettingsProfileElements>();
boost::range::push_back(settings->elements, std::move(new_settings));
insertAtEnd(settings->elements, std::move(new_settings));
continue;
}

View File

@ -5,7 +5,7 @@
#include <Parsers/ExpressionListParsers.h>
#include <Parsers/parseIdentifierOrStringLiteral.h>
#include <Parsers/parseDatabaseAndTableName.h>
#include <boost/range/algorithm_ext/push_back.hpp>
#include <base/insertAtEnd.h>
namespace DB
@ -179,7 +179,7 @@ bool ParserRowPolicyNames::parseImpl(Pos & pos, ASTPtr & node, Expected & expect
return false;
num_added_names_last_time = new_full_names.size();
boost::range::push_back(full_names, std::move(new_full_names));
insertAtEnd(full_names, std::move(new_full_names));
return true;
};

View File

@ -22,8 +22,8 @@ namespace ErrorCodes
QueryPlan::QueryPlan() = default;
QueryPlan::~QueryPlan() = default;
QueryPlan::QueryPlan(QueryPlan &&) = default;
QueryPlan & QueryPlan::operator=(QueryPlan &&) = default;
QueryPlan::QueryPlan(QueryPlan &&) noexcept = default;
QueryPlan & QueryPlan::operator=(QueryPlan &&) noexcept = default;
void QueryPlan::checkInitialized() const
{

View File

@ -44,8 +44,8 @@ class QueryPlan
public:
QueryPlan();
~QueryPlan();
QueryPlan(QueryPlan &&);
QueryPlan & operator=(QueryPlan &&);
QueryPlan(QueryPlan &&) noexcept;
QueryPlan & operator=(QueryPlan &&) noexcept;
void unitePlans(QueryPlanStepPtr step, std::vector<QueryPlanPtr> plans);
void addStep(QueryPlanStepPtr step);

View File

@ -5,10 +5,10 @@ namespace DB
{
PipelineResourcesHolder::PipelineResourcesHolder() = default;
PipelineResourcesHolder::PipelineResourcesHolder(PipelineResourcesHolder &&) = default;
PipelineResourcesHolder::PipelineResourcesHolder(PipelineResourcesHolder &&) noexcept = default;
PipelineResourcesHolder::~PipelineResourcesHolder() = default;
PipelineResourcesHolder & PipelineResourcesHolder::operator=(PipelineResourcesHolder && rhs)
PipelineResourcesHolder & PipelineResourcesHolder::operator=(PipelineResourcesHolder && rhs) noexcept
{
table_locks.insert(table_locks.end(), rhs.table_locks.begin(), rhs.table_locks.end());
storage_holders.insert(storage_holders.end(), rhs.storage_holders.begin(), rhs.storage_holders.end());

View File

@ -16,10 +16,10 @@ class Context;
struct PipelineResourcesHolder
{
PipelineResourcesHolder();
PipelineResourcesHolder(PipelineResourcesHolder &&);
PipelineResourcesHolder(PipelineResourcesHolder &&) noexcept;
~PipelineResourcesHolder();
/// Custom mode assignment does not destroy data from lhs. It appends data from rhs to lhs.
PipelineResourcesHolder& operator=(PipelineResourcesHolder &&);
PipelineResourcesHolder& operator=(PipelineResourcesHolder &&) noexcept;
/// Some processors may implicitly use Context or temporary Storage created by Interpreter.
/// But lifetime of Streams is not nested in lifetime of Interpreters, so we have to store it here,

View File

@ -24,8 +24,8 @@ namespace ErrorCodes
}
QueryPipeline::QueryPipeline() = default;
QueryPipeline::QueryPipeline(QueryPipeline &&) = default;
QueryPipeline & QueryPipeline::operator=(QueryPipeline &&) = default;
QueryPipeline::QueryPipeline(QueryPipeline &&) noexcept = default;
QueryPipeline & QueryPipeline::operator=(QueryPipeline &&) noexcept = default;
QueryPipeline::~QueryPipeline() = default;
static void checkInput(const InputPort & input, const ProcessorPtr & processor)

View File

@ -32,10 +32,10 @@ class QueryPipeline
{
public:
QueryPipeline();
QueryPipeline(QueryPipeline &&);
QueryPipeline(QueryPipeline &&) noexcept;
QueryPipeline(const QueryPipeline &) = delete;
QueryPipeline & operator=(QueryPipeline &&);
QueryPipeline & operator=(QueryPipeline &&) noexcept;
QueryPipeline & operator=(const QueryPipeline &) = delete;
~QueryPipeline();

View File

@ -174,7 +174,7 @@ bool RemoteQueryExecutorReadContext::resumeRoutine()
fiber = std::move(fiber).resume();
if (exception)
std::rethrow_exception(std::move(exception));
std::rethrow_exception(exception);
}
return true;

View File

@ -22,6 +22,9 @@ struct StorageInfo
StorageInfo(StoragePtr storage_, const PostgreSQLTableStructure::Attributes & attributes_)
: storage(storage_), attributes(attributes_) {}
StorageInfo(StoragePtr storage_, PostgreSQLTableStructure::Attributes && attributes_)
: storage(storage_), attributes(std::move(attributes_)) {}
};
using StorageInfos = std::unordered_map<String, StorageInfo>;

View File

@ -240,7 +240,7 @@ public:
WriteBufferFromString wb(serialized_keys[rows_processed]);
key_column_type->getDefaultSerialization()->serializeBinary(*it, wb);
wb.finalize();
slices_keys[rows_processed] = std::move(serialized_keys[rows_processed]);
slices_keys[rows_processed] = serialized_keys[rows_processed];
++it;
++rows_processed;

View File

@ -857,7 +857,7 @@ FuncRet likeFunc(DB::ASTPtr ch, std::map<std::string, Column> & columns)
{
std::string value = applyVisitor(DB::FieldVisitorToString(), literal->value);
std::string example{};
for (size_t i = 0; i != value.size(); ++i)
for (size_t i = 0; i != value.size(); ++i) /// NOLINT
{
if (value[i] == '%')
example += randomString(rng() % 10);

View File

@ -35,7 +35,7 @@ std::vector<StringRef> loadMetrics(const std::string & metrics_file)
throw std::runtime_error(strerror(errno));
}
while ((nread = getline(&line, &len, stream)) != -1)
while ((nread = getline(&line, &len, stream)) != -1) /// NOLINT
{
size_t l = strlen(line);
if (l > 0)

View File

@ -673,7 +673,7 @@ static uint8_t * memcpy_my2(uint8_t * __restrict dst, const uint8_t * __restrict
size -= padding;
}
while (size >= 512)
while (size >= 512) /// NOLINT
{
__asm__(
"vmovups (%[s]), %%ymm0\n"
@ -794,19 +794,19 @@ static uint8_t * memcpy_my2(uint8_t * __restrict dst, const uint8_t * __restrict
return ret;
}
extern "C" void * __memcpy_erms(void * __restrict destination, const void * __restrict source, size_t size);
extern "C" void * __memcpy_sse2_unaligned(void * __restrict destination, const void * __restrict source, size_t size);
extern "C" void * __memcpy_ssse3(void * __restrict destination, const void * __restrict source, size_t size);
extern "C" void * __memcpy_ssse3_back(void * __restrict destination, const void * __restrict source, size_t size);
extern "C" void * __memcpy_avx_unaligned(void * __restrict destination, const void * __restrict source, size_t size);
extern "C" void * __memcpy_avx_unaligned_erms(void * __restrict destination, const void * __restrict source, size_t size);
extern "C" void * __memcpy_avx512_unaligned(void * __restrict destination, const void * __restrict source, size_t size);
extern "C" void * __memcpy_avx512_unaligned_erms(void * __restrict destination, const void * __restrict source, size_t size);
extern "C" void * __memcpy_avx512_no_vzeroupper(void * __restrict destination, const void * __restrict source, size_t size);
extern "C" void * __memcpy_erms(void * __restrict destination, const void * __restrict source, size_t size); /// NOLINT
extern "C" void * __memcpy_sse2_unaligned(void * __restrict destination, const void * __restrict source, size_t size); /// NOLINT
extern "C" void * __memcpy_ssse3(void * __restrict destination, const void * __restrict source, size_t size); /// NOLINT
extern "C" void * __memcpy_ssse3_back(void * __restrict destination, const void * __restrict source, size_t size); /// NOLINT
extern "C" void * __memcpy_avx_unaligned(void * __restrict destination, const void * __restrict source, size_t size); /// NOLINT
extern "C" void * __memcpy_avx_unaligned_erms(void * __restrict destination, const void * __restrict source, size_t size); /// NOLINT
extern "C" void * __memcpy_avx512_unaligned(void * __restrict destination, const void * __restrict source, size_t size); /// NOLINT
extern "C" void * __memcpy_avx512_unaligned_erms(void * __restrict destination, const void * __restrict source, size_t size); /// NOLINT
extern "C" void * __memcpy_avx512_no_vzeroupper(void * __restrict destination, const void * __restrict source, size_t size); /// NOLINT
#define VARIANT(N, NAME) \
if (memcpy_variant == N) \
if (memcpy_variant == (N)) \
return test(dst, src, size, iterations, num_threads, std::forward<F>(generator), NAME, #NAME);
template <typename F>