diff --git a/src/puml/class_diagram_generator.h b/src/puml/class_diagram_generator.h index 31e5771d..ad974b35 100644 --- a/src/puml/class_diagram_generator.h +++ b/src/puml/class_diagram_generator.h @@ -130,7 +130,8 @@ public: if (m.type != "void") type = m.type + " "; - ostr << to_string(m.scope) << type << m.name; + ostr << to_string(m.scope) + << ns_relative(m_config.using_namespace, type) << m.name; ostr << "("; if (true) { // TODO: add option to disable parameter generation diff --git a/src/uml/class_diagram_visitor.h b/src/uml/class_diagram_visitor.h index 0d75d8b0..b581345b 100644 --- a/src/uml/class_diagram_visitor.h +++ b/src/uml/class_diagram_visitor.h @@ -452,8 +452,9 @@ static enum CXChildVisitResult class_visitor( clang_visitChildren( cursor.get(), method_parameter_visitor, &method_ctx); - spdlog::debug("Adding method {} {}::{}()", m.type, - ctx->element.name, cursor.spelling()); + spdlog::debug("Adding method {} {}::{}()", + cursor.type().result_type(), ctx->element.name, + cursor.spelling()); ctx->element.methods.emplace_back(std::move(m)); }); diff --git a/tests/t00003/t00003.cc b/tests/t00003/t00003.cc index b3176941..bc9b3f6e 100644 --- a/tests/t00003/t00003.cc +++ b/tests/t00003/t00003.cc @@ -6,6 +6,10 @@ namespace t00003 { class A { public: A() = default; + A(int i) + : private_member{i} + { + } A(A &&) = default; A(const A &) = default; virtual ~A() = default; @@ -19,11 +23,13 @@ public: auto sum(const double a, const double b) { return a + b; } auto default_int(int i = 12) { return i + 10; } - auto default_string(int i, std::string s = "abc") + std::string default_string(int i, std::string s = "abc") { return s + std::to_string(i); } + static A create_from_int(int i) { return A(i); } + int public_member; static int static_int; static const int static_const_int = 1;