From 57aa174a86b44a5e2e16ac930aa2953fb4d26dd4 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Mon, 15 May 2023 00:57:04 +0200 Subject: [PATCH] Fixed t00064 on LLVM 16 --- src/class_diagram/visitor/template_builder.cc | 10 +++++----- src/class_diagram/visitor/translation_unit_visitor.cc | 2 +- tests/t00064/test_case.h | 7 +++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/class_diagram/visitor/template_builder.cc b/src/class_diagram/visitor/template_builder.cc index 23217861..0e56f5e9 100644 --- a/src/class_diagram/visitor/template_builder.cc +++ b/src/class_diagram/visitor/template_builder.cc @@ -871,7 +871,7 @@ std::optional template_builder::try_as_function_prototype( clang::QualType &type, class_ &template_instantiation, size_t argument_index) { - auto *function_type = type->getAs(); + const auto *function_type = type->getAs(); if (function_type == nullptr && type->isFunctionPointerType()) { function_type = @@ -915,10 +915,10 @@ std::optional template_builder::try_as_function_prototype( } std::optional template_builder::try_as_decl_type( - std::optional &parent, - const clang::NamedDecl *cls, const clang::TemplateDecl *template_decl, - clang::QualType &type, class_ &template_instantiation, - size_t argument_index) + std::optional & /*parent*/, + const clang::NamedDecl * /*cls*/, + const clang::TemplateDecl * /*template_decl*/, clang::QualType &type, + class_ & /*template_instantiation*/, size_t /*argument_index*/) { const auto *decl_type = common::dereference(type)->getAs(); diff --git a/src/class_diagram/visitor/translation_unit_visitor.cc b/src/class_diagram/visitor/translation_unit_visitor.cc index 5158736e..66d5a526 100644 --- a/src/class_diagram/visitor/translation_unit_visitor.cc +++ b/src/class_diagram/visitor/translation_unit_visitor.cc @@ -1610,7 +1610,7 @@ bool translation_unit_visitor::find_relationships(const clang::QualType &type, void translation_unit_visitor::process_function_parameter( const clang::ParmVarDecl &p, class_method &method, class_ &c, - const std::set &template_parameter_names) + const std::set & /*template_parameter_names*/) { method_parameter parameter; parameter.set_name(p.getNameAsString()); diff --git a/tests/t00064/test_case.h b/tests/t00064/test_case.h index e7655c98..804a4f96 100644 --- a/tests/t00064/test_case.h +++ b/tests/t00064/test_case.h @@ -64,11 +64,18 @@ TEST_CASE("t00064", "[test-case][class]") "It,type_list,type_list")); REQUIRE_THAT( puml, (IsMethod("get", "ref_t", "unsigned int i"))); +#if LLVM_VERSION_MAJOR < 16 REQUIRE_THAT(puml, (IsMethod("getp", "value_type const*", "unsigned int i"))); REQUIRE_THAT(puml, (IsMethod("find", "unsigned int", "value_type const& v"))); +#else + REQUIRE_THAT(puml, + (IsMethod("getp", "const value_type *", "unsigned int i"))); + REQUIRE_THAT(puml, + (IsMethod("find", "unsigned int", "const value_type & v"))); +#endif save_puml( config.output_directory() + "/" + diagram->name + ".puml", puml); }