Fixed clang-tidy warnings
This commit is contained in:
@@ -946,11 +946,8 @@ bool is_struct(const clang::NamedDecl *decl)
|
|||||||
|
|
||||||
bool has_attr(const clang::FunctionDecl *decl, clang::attr::Kind function_attr)
|
bool has_attr(const clang::FunctionDecl *decl, clang::attr::Kind function_attr)
|
||||||
{
|
{
|
||||||
for (const auto &attr : decl->attrs()) {
|
return std::any_of(decl->attrs().begin(), decl->attrs().end(),
|
||||||
if (attr->getKind() == function_attr)
|
[function_attr](
|
||||||
return true;
|
auto &&attr) { return attr->getKind() == function_attr; });
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
} // namespace clanguml::common
|
} // namespace clanguml::common
|
||||||
|
|||||||
@@ -454,14 +454,14 @@ void diagram::inline_lambda_operator_calls()
|
|||||||
// Skip participants which are lambda classes
|
// Skip participants which are lambda classes
|
||||||
if (const auto *maybe_class =
|
if (const auto *maybe_class =
|
||||||
dynamic_cast<const model::class_ *>(p.get());
|
dynamic_cast<const model::class_ *>(p.get());
|
||||||
maybe_class && maybe_class->is_lambda()) {
|
maybe_class != nullptr && maybe_class->is_lambda()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip participants which are lambda operator methods
|
// Skip participants which are lambda operator methods
|
||||||
if (const auto *maybe_method =
|
if (const auto *maybe_method =
|
||||||
dynamic_cast<const model::method *>(p.get());
|
dynamic_cast<const model::method *>(p.get());
|
||||||
maybe_method) {
|
maybe_method != nullptr) {
|
||||||
auto maybe_class =
|
auto maybe_class =
|
||||||
get_participant<model::class_>(maybe_method->class_id());
|
get_participant<model::class_>(maybe_method->class_id());
|
||||||
if (maybe_class && maybe_class.value().is_lambda())
|
if (maybe_class && maybe_class.value().is_lambda())
|
||||||
@@ -475,7 +475,7 @@ void diagram::inline_lambda_operator_calls()
|
|||||||
|
|
||||||
// Skip active participants which are not in lambdaless_diagram participants
|
// Skip active participants which are not in lambdaless_diagram participants
|
||||||
for (auto id : this->active_participants()) {
|
for (auto id : this->active_participants()) {
|
||||||
if (participants.count(id)) {
|
if (participants.count(id) > 0) {
|
||||||
active_participants.emplace(id);
|
active_participants.emplace(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -485,8 +485,8 @@ void diagram::inline_lambda_operator_calls()
|
|||||||
active_participants_ = std::move(active_participants);
|
active_participants_ = std::move(active_participants);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool diagram::inline_lambda_operator_call(
|
bool diagram::inline_lambda_operator_call(const common::id_t id,
|
||||||
const long id, model::activity &new_activity, const model::message &m)
|
model::activity &new_activity, const model::message &m)
|
||||||
{
|
{
|
||||||
bool message_call_to_lambda{false};
|
bool message_call_to_lambda{false};
|
||||||
auto maybe_lambda_operator = get_participant<model::method>(m.to());
|
auto maybe_lambda_operator = get_participant<model::method>(m.to());
|
||||||
|
|||||||
@@ -344,8 +344,8 @@ private:
|
|||||||
return block_end_types.count(mt) > 0;
|
return block_end_types.count(mt) > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool inline_lambda_operator_call(
|
bool inline_lambda_operator_call(common::id_t id,
|
||||||
const long id, model::activity &new_activity, const model::message &m);
|
model::activity &new_activity, const model::message &m);
|
||||||
|
|
||||||
std::map<common::id_t, activity> activities_;
|
std::map<common::id_t, activity> activities_;
|
||||||
|
|
||||||
|
|||||||
@@ -1601,8 +1601,8 @@ bool translation_unit_visitor::process_unresolved_lookup_call_expression(
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (clang::dyn_cast_or_null<clang::FunctionDecl>(decl) !=
|
|
||||||
nullptr) {
|
if (clang::dyn_cast_or_null<clang::FunctionDecl>(decl) != nullptr) {
|
||||||
const auto *fd =
|
const auto *fd =
|
||||||
clang::dyn_cast_or_null<clang::FunctionDecl>(decl);
|
clang::dyn_cast_or_null<clang::FunctionDecl>(decl);
|
||||||
|
|
||||||
@@ -1615,9 +1615,8 @@ bool translation_unit_visitor::process_unresolved_lookup_call_expression(
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
LOG_DBG("Unknown unresolved lookup expression");
|
LOG_DBG("Unknown unresolved lookup expression");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user