Fixed template template example
This commit is contained in:
@@ -306,7 +306,10 @@ void tu_visitor::process_field(const cppast::cpp_member_variable &mv, class_ &c,
|
||||
spdlog::debug(
|
||||
"Processing field with unreferenced type of kind {}", tr.kind());
|
||||
|
||||
if (tr.kind() == cppast::cpp_type_kind::template_instantiation_t) {
|
||||
if (tr.kind() == cppast::cpp_type_kind::builtin_t) {
|
||||
spdlog::debug("Builtin type found for field: {}", m.name);
|
||||
}
|
||||
else if (tr.kind() == cppast::cpp_type_kind::template_instantiation_t) {
|
||||
spdlog::debug("Processing field with template instatiation type {}",
|
||||
cppast::to_string(tr));
|
||||
|
||||
|
||||
@@ -17,19 +17,18 @@ public:
|
||||
CMP comparator;
|
||||
};
|
||||
|
||||
/*
|
||||
* TODO: Handle template template properly.
|
||||
*
|
||||
template <typename T> struct Vector {
|
||||
std::vector<T> values;
|
||||
};
|
||||
|
||||
template <typename T, template <typename> typename C> struct B {
|
||||
C<T> template_template;
|
||||
};
|
||||
|
||||
struct D {
|
||||
// libclang claims that the type spelling of 'ints' is 'int'...
|
||||
B<int, std::vector> ints;
|
||||
B<int, Vector> ints;
|
||||
|
||||
void add(int i) { ints.template_template.push_back(i); }
|
||||
void add(int i) { ints.template_template.values.push_back(i); }
|
||||
};
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ TEST_CASE("t00008", "[test-case][class]")
|
||||
REQUIRE_THAT(puml, StartsWith("@startuml"));
|
||||
REQUIRE_THAT(puml, EndsWith("@enduml\n"));
|
||||
REQUIRE_THAT(puml, IsClassTemplate("A", "T, P, bool (*)(int, int), int N"));
|
||||
REQUIRE_THAT(puml, IsClassTemplate("B", "T, C<>"));
|
||||
|
||||
REQUIRE_THAT(puml, IsField(Public("T value")));
|
||||
REQUIRE_THAT(puml, IsField(Public("T * pointer")));
|
||||
|
||||
Reference in New Issue
Block a user