Fixed t00064 on LLVM 16

This commit is contained in:
Bartek Kryza
2023-05-15 00:57:04 +02:00
parent 02f470e563
commit 57aa174a86
3 changed files with 13 additions and 6 deletions

View File

@@ -871,7 +871,7 @@ std::optional<template_parameter> template_builder::try_as_function_prototype(
clang::QualType &type, class_ &template_instantiation,
size_t argument_index)
{
auto *function_type = type->getAs<clang::FunctionProtoType>();
const auto *function_type = type->getAs<clang::FunctionProtoType>();
if (function_type == nullptr && type->isFunctionPointerType()) {
function_type =
@@ -915,10 +915,10 @@ std::optional<template_parameter> template_builder::try_as_function_prototype(
}
std::optional<template_parameter> template_builder::try_as_decl_type(
std::optional<clanguml::class_diagram::model::class_ *> &parent,
const clang::NamedDecl *cls, const clang::TemplateDecl *template_decl,
clang::QualType &type, class_ &template_instantiation,
size_t argument_index)
std::optional<clanguml::class_diagram::model::class_ *> & /*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<clang::DecltypeType>();

View File

@@ -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<std::string> &template_parameter_names)
const std::set<std::string> & /*template_parameter_names*/)
{
method_parameter parameter;
parameter.set_name(p.getNameAsString());

View File

@@ -64,11 +64,18 @@ TEST_CASE("t00064", "[test-case][class]")
"It,type_list<First...>,type_list<Second...>"));
REQUIRE_THAT(
puml, (IsMethod<Public>("get", "ref_t", "unsigned int i")));
#if LLVM_VERSION_MAJOR < 16
REQUIRE_THAT(puml,
(IsMethod<Public>("getp", "value_type const*", "unsigned int i")));
REQUIRE_THAT(puml,
(IsMethod<Public>("find", "unsigned int", "value_type const& v")));
#else
REQUIRE_THAT(puml,
(IsMethod<Public>("getp", "const value_type *", "unsigned int i")));
REQUIRE_THAT(puml,
(IsMethod<Public>("find", "unsigned int", "const value_type & v")));
#endif
save_puml(
config.output_directory() + "/" + diagram->name + ".puml", puml);
}