Updated to clang-tidy-17
This commit is contained in:
2
Makefile
2
Makefile
@@ -163,7 +163,7 @@ format:
|
||||
|
||||
.PHONY: debug_tidy
|
||||
tidy: debug_tidy
|
||||
run-clang-tidy-15 -extra-arg=-Wno-unknown-warning-option -j $(NUMPROC) -p debug_tidy ./src
|
||||
run-clang-tidy-17 -extra-arg=-Wno-unknown-warning-option -j $(NUMPROC) -p debug_tidy ./src
|
||||
|
||||
.PHONY: check-formatting
|
||||
check-formatting:
|
||||
|
||||
@@ -917,7 +917,7 @@ void translation_unit_visitor::process_record_parent(
|
||||
std::string destination_multiplicity_str{};
|
||||
if (destination_multiplicity.has_value()) {
|
||||
destination_multiplicity_str =
|
||||
std::to_string(*destination_multiplicity); // NOLINT
|
||||
std::to_string(*destination_multiplicity);
|
||||
}
|
||||
|
||||
parent_class.value().add_relationship(
|
||||
@@ -1673,8 +1673,8 @@ void translation_unit_visitor::add_relationships(class_ &c,
|
||||
}
|
||||
if (!mulitplicity_provided_in_comment &&
|
||||
field.destination_multiplicity().has_value()) {
|
||||
r.set_multiplicity_destination(std::to_string(
|
||||
*field.destination_multiplicity())); // NOLINT
|
||||
r.set_multiplicity_destination(
|
||||
std::to_string(*field.destination_multiplicity()));
|
||||
}
|
||||
|
||||
r.set_style(field.style_spec());
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "class_diagram/generators/plantuml/class_diagram_generator.h"
|
||||
#include "cli/cli_handler.h"
|
||||
#include "common/compilation_database.h"
|
||||
#include "common/generators/generators.h"
|
||||
#include "common/model/diagram_filter.h"
|
||||
#include "config/config.h"
|
||||
#include "include_diagram/generators/json/include_diagram_generator.h"
|
||||
|
||||
@@ -684,8 +684,9 @@ std::vector<common::id_t> translation_unit_visitor::get_parent_package_ids(
|
||||
std::optional<common::id_t> parent_id = id;
|
||||
|
||||
while (parent_id.has_value()) {
|
||||
parent_ids.push_back(parent_id.value());
|
||||
auto parent = this->diagram().get(parent_id.value());
|
||||
const auto pid = parent_id.value(); // NOLINT
|
||||
parent_ids.push_back(pid);
|
||||
auto parent = this->diagram().get(pid);
|
||||
if (parent)
|
||||
parent_id = parent.value().parent_element_id();
|
||||
else
|
||||
|
||||
@@ -158,7 +158,7 @@ void call_expression_context::enter_lambda_expression(common::id_t id)
|
||||
|
||||
assert(id.value() != 0);
|
||||
|
||||
current_lambda_caller_id_.push(id);
|
||||
current_lambda_caller_id_.emplace(id);
|
||||
}
|
||||
|
||||
void call_expression_context::leave_lambda_expression()
|
||||
@@ -182,7 +182,7 @@ clang::IfStmt *call_expression_context::current_ifstmt() const
|
||||
|
||||
void call_expression_context::enter_ifstmt(clang::IfStmt *stmt)
|
||||
{
|
||||
if_stmt_stack_.push(stmt);
|
||||
if_stmt_stack_.emplace(stmt);
|
||||
}
|
||||
|
||||
void call_expression_context::leave_ifstmt()
|
||||
@@ -197,7 +197,7 @@ void call_expression_context::enter_elseifstmt(clang::IfStmt *stmt)
|
||||
{
|
||||
assert(current_ifstmt() != nullptr);
|
||||
|
||||
elseif_stmt_stacks_[current_ifstmt()].push(stmt);
|
||||
elseif_stmt_stacks_[current_ifstmt()].emplace(stmt);
|
||||
}
|
||||
|
||||
clang::IfStmt *call_expression_context::current_elseifstmt() const
|
||||
@@ -221,7 +221,7 @@ clang::Stmt *call_expression_context::current_loopstmt() const
|
||||
|
||||
void call_expression_context::enter_loopstmt(clang::Stmt *stmt)
|
||||
{
|
||||
loop_stmt_stack_.push(stmt);
|
||||
loop_stmt_stack_.emplace(stmt);
|
||||
}
|
||||
|
||||
void call_expression_context::leave_loopstmt()
|
||||
@@ -241,12 +241,12 @@ call_expression_context::current_callexpr() const
|
||||
|
||||
void call_expression_context::enter_callexpr(clang::CallExpr *expr)
|
||||
{
|
||||
call_expr_stack_.push(expr);
|
||||
call_expr_stack_.emplace(expr);
|
||||
}
|
||||
|
||||
void call_expression_context::enter_callexpr(clang::CXXConstructExpr *expr)
|
||||
{
|
||||
call_expr_stack_.push(expr);
|
||||
call_expr_stack_.emplace(expr);
|
||||
}
|
||||
|
||||
void call_expression_context::leave_callexpr()
|
||||
@@ -266,7 +266,7 @@ clang::Stmt *call_expression_context::current_trystmt() const
|
||||
|
||||
void call_expression_context::enter_trystmt(clang::Stmt *stmt)
|
||||
{
|
||||
try_stmt_stack_.push(stmt);
|
||||
try_stmt_stack_.emplace(stmt);
|
||||
}
|
||||
|
||||
void call_expression_context::leave_trystmt()
|
||||
@@ -285,7 +285,7 @@ clang::SwitchStmt *call_expression_context::current_switchstmt() const
|
||||
|
||||
void call_expression_context::enter_switchstmt(clang::SwitchStmt *stmt)
|
||||
{
|
||||
switch_stmt_stack_.push(stmt);
|
||||
switch_stmt_stack_.emplace(stmt);
|
||||
}
|
||||
|
||||
void call_expression_context::leave_switchstmt()
|
||||
@@ -306,7 +306,7 @@ call_expression_context::current_conditionaloperator() const
|
||||
void call_expression_context::enter_conditionaloperator(
|
||||
clang::ConditionalOperator *stmt)
|
||||
{
|
||||
conditional_operator_stack_.push(stmt);
|
||||
conditional_operator_stack_.emplace(stmt);
|
||||
}
|
||||
|
||||
void call_expression_context::leave_conditionaloperator()
|
||||
|
||||
@@ -1930,15 +1930,16 @@ std::string translation_unit_visitor::make_lambda_name(
|
||||
const auto location = cls->getLocation();
|
||||
const std::string source_location{lambda_source_location(location)};
|
||||
|
||||
if (context().lambda_caller_id().has_value()) {
|
||||
const auto maybe_lambda_caller_id = context().lambda_caller_id();
|
||||
if (maybe_lambda_caller_id.has_value()) {
|
||||
// Parent is also a lambda (this id points to a lambda operator())
|
||||
std::string parent_lambda_class_name{"()"};
|
||||
if (diagram().get_participant<model::method>(
|
||||
context().lambda_caller_id().value())) { // NOLINT
|
||||
maybe_lambda_caller_id.value())) {
|
||||
auto parent_lambda_class_id =
|
||||
diagram()
|
||||
.get_participant<model::method>(
|
||||
context().lambda_caller_id().value()) // NOLINT
|
||||
maybe_lambda_caller_id.value())
|
||||
.value()
|
||||
.class_id();
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ template <typename T, typename S>
|
||||
std::unique_ptr<T> unique_pointer_cast(std::unique_ptr<S> &&p) noexcept
|
||||
{
|
||||
if (T *const converted = dynamic_cast<T *>(p.get())) {
|
||||
p.release(); // NOLINT
|
||||
std::move(p).release(); // NOLINT
|
||||
return std::unique_ptr<T>{converted};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user