Applied readability-qualified-auto clang-tidy fixes
This commit is contained in:
@@ -64,7 +64,7 @@ model::namespace_ get_tag_namespace(const clang::TagDecl &declaration)
|
|||||||
{
|
{
|
||||||
model::namespace_ ns;
|
model::namespace_ ns;
|
||||||
|
|
||||||
auto *parent{declaration.getParent()};
|
const auto *parent{declaration.getParent()};
|
||||||
|
|
||||||
// First walk up to the nearest namespace, e.g. from nested class or enum
|
// First walk up to the nearest namespace, e.g. from nested class or enum
|
||||||
while (parent && !parent->isNamespace()) {
|
while (parent && !parent->isNamespace()) {
|
||||||
@@ -103,7 +103,7 @@ std::string get_tag_name(const clang::TagDecl &declaration)
|
|||||||
std::deque<std::string> record_parent_names;
|
std::deque<std::string> record_parent_names;
|
||||||
record_parent_names.push_front(base_name);
|
record_parent_names.push_front(base_name);
|
||||||
|
|
||||||
auto *cls_parent{declaration.getParent()};
|
const auto *cls_parent{declaration.getParent()};
|
||||||
while (cls_parent->isRecord()) {
|
while (cls_parent->isRecord()) {
|
||||||
auto parent_name =
|
auto parent_name =
|
||||||
static_cast<const clang::RecordDecl *>(cls_parent)
|
static_cast<const clang::RecordDecl *>(cls_parent)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ bool decorated_element::skip_relationship() const
|
|||||||
std::pair<relationship_t, std::string>
|
std::pair<relationship_t, std::string>
|
||||||
decorated_element::get_relationship() const
|
decorated_element::get_relationship() const
|
||||||
{
|
{
|
||||||
for (auto &d : decorators_)
|
for (const auto &d : decorators_)
|
||||||
if (std::dynamic_pointer_cast<decorators::association>(d))
|
if (std::dynamic_pointer_cast<decorators::association>(d))
|
||||||
return {relationship_t::kAssociation,
|
return {relationship_t::kAssociation,
|
||||||
std::dynamic_pointer_cast<decorators::relationship>(d)
|
std::dynamic_pointer_cast<decorators::relationship>(d)
|
||||||
|
|||||||
@@ -87,8 +87,9 @@ void clang_visitor::visit(
|
|||||||
clang::dyn_cast<TParamCommandComment>(block), traits, cmt);
|
clang::dyn_cast<TParamCommandComment>(block), traits, cmt);
|
||||||
}
|
}
|
||||||
else if (block_kind == Comment::BlockCommandCommentKind) {
|
else if (block_kind == Comment::BlockCommandCommentKind) {
|
||||||
auto *command = clang::dyn_cast<BlockCommandComment>(block);
|
const auto *command = clang::dyn_cast<BlockCommandComment>(block);
|
||||||
auto command_info = traits.getCommandInfo(command->getCommandID());
|
const auto *command_info =
|
||||||
|
traits.getCommandInfo(command->getCommandID());
|
||||||
|
|
||||||
if (command_info->IsBlockCommand && command_info->NumArgs == 0) {
|
if (command_info->IsBlockCommand && command_info->NumArgs == 0) {
|
||||||
// Visit block command with a single text argument, e.g.:
|
// Visit block command with a single text argument, e.g.:
|
||||||
@@ -125,7 +126,7 @@ void clang_visitor::visit_block_command(
|
|||||||
|
|
||||||
std::string command_text;
|
std::string command_text;
|
||||||
|
|
||||||
for (auto paragraph_it = command->child_begin();
|
for (const auto *paragraph_it = command->child_begin();
|
||||||
paragraph_it != command->child_end(); ++paragraph_it) {
|
paragraph_it != command->child_end(); ++paragraph_it) {
|
||||||
|
|
||||||
if ((*paragraph_it)->getCommentKind() ==
|
if ((*paragraph_it)->getCommentKind() ==
|
||||||
@@ -156,7 +157,8 @@ void clang_visitor::visit_param_command(
|
|||||||
|
|
||||||
const auto name = command->getParamNameAsWritten().str();
|
const auto name = command->getParamNameAsWritten().str();
|
||||||
|
|
||||||
for (auto it = command->child_begin(); it != command->child_end(); ++it) {
|
for (const auto *it = command->child_begin(); it != command->child_end();
|
||||||
|
++it) {
|
||||||
|
|
||||||
if ((*it)->getCommentKind() == Comment::ParagraphCommentKind) {
|
if ((*it)->getCommentKind() == Comment::ParagraphCommentKind) {
|
||||||
visit_paragraph(
|
visit_paragraph(
|
||||||
@@ -187,7 +189,8 @@ void clang_visitor::visit_tparam_command(
|
|||||||
|
|
||||||
const auto name = command->getParamNameAsWritten().str();
|
const auto name = command->getParamNameAsWritten().str();
|
||||||
|
|
||||||
for (auto it = command->child_begin(); it != command->child_end(); ++it) {
|
for (const auto *it = command->child_begin(); it != command->child_end();
|
||||||
|
++it) {
|
||||||
if ((*it)->getCommentKind() == Comment::ParagraphCommentKind) {
|
if ((*it)->getCommentKind() == Comment::ParagraphCommentKind) {
|
||||||
visit_paragraph(
|
visit_paragraph(
|
||||||
clang::dyn_cast<ParagraphComment>(*it), traits, description);
|
clang::dyn_cast<ParagraphComment>(*it), traits, description);
|
||||||
@@ -212,7 +215,7 @@ void clang_visitor::visit_paragraph(
|
|||||||
using clang::comments::Comment;
|
using clang::comments::Comment;
|
||||||
using clang::comments::TextComment;
|
using clang::comments::TextComment;
|
||||||
|
|
||||||
for (auto text_it = paragraph->child_begin();
|
for (const auto *text_it = paragraph->child_begin();
|
||||||
text_it != paragraph->child_end(); ++text_it) {
|
text_it != paragraph->child_end(); ++text_it) {
|
||||||
|
|
||||||
if ((*text_it)->getCommentKind() == Comment::TextCommentKind) {
|
if ((*text_it)->getCommentKind() == Comment::TextCommentKind) {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ decorator_toks decorator::tokenize(const std::string &label, std::string_view c)
|
|||||||
decorator_toks res;
|
decorator_toks res;
|
||||||
res.label = label;
|
res.label = label;
|
||||||
size_t pos{};
|
size_t pos{};
|
||||||
auto it = c.begin();
|
const auto *it = c.begin();
|
||||||
std::advance(it, label.size());
|
std::advance(it, label.size());
|
||||||
|
|
||||||
if (*it == ':') {
|
if (*it == ':') {
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ void translation_unit_visitor::process_class_children(
|
|||||||
void translation_unit_visitor::process_class_bases(
|
void translation_unit_visitor::process_class_bases(
|
||||||
const clang::CXXRecordDecl &cls, found_relationships_t &relationships)
|
const clang::CXXRecordDecl &cls, found_relationships_t &relationships)
|
||||||
{
|
{
|
||||||
for (auto &base : cls.bases()) {
|
for (const auto &base : cls.bases()) {
|
||||||
find_relationships(base.getType(), relationships);
|
find_relationships(base.getType(), relationships);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -336,7 +336,7 @@ bool translation_unit_visitor::find_relationships(const clang::QualType &type,
|
|||||||
relationships.emplace_back(
|
relationships.emplace_back(
|
||||||
common::to_id(*type->getAs<clang::EnumType>()), relationship_hint);
|
common::to_id(*type->getAs<clang::EnumType>()), relationship_hint);
|
||||||
}
|
}
|
||||||
else if (auto *template_specialization_type =
|
else if (const auto *template_specialization_type =
|
||||||
type->getAs<clang::TemplateSpecializationType>()) {
|
type->getAs<clang::TemplateSpecializationType>()) {
|
||||||
if (template_specialization_type != nullptr) {
|
if (template_specialization_type != nullptr) {
|
||||||
if (template_specialization_type->isTypeAlias())
|
if (template_specialization_type->isTypeAlias())
|
||||||
|
|||||||
Reference in New Issue
Block a user