Fixed handling of template class specializations nested in other classes
This commit is contained in:
@@ -32,5 +32,20 @@ struct D {
|
||||
|
||||
void add(int i) { ints.template_template.values.push_back(i); }
|
||||
};
|
||||
|
||||
struct E {
|
||||
template <typename ET> struct nested_template {
|
||||
using DT = ET;
|
||||
|
||||
static DT *get(ET *d) { return d; }
|
||||
};
|
||||
};
|
||||
|
||||
template <> struct E::nested_template<char> {
|
||||
using DeclType = char;
|
||||
|
||||
static DeclType *getDecl(char *c) { return c; }
|
||||
};
|
||||
|
||||
} // namespace t00008
|
||||
} // namespace clanguml
|
||||
|
||||
@@ -48,5 +48,12 @@ TEST_CASE("t00008", "[test-case][class]")
|
||||
// REQUIRE_THAT(puml, IsField(Public("bool (*)(int, int) comparator")));
|
||||
REQUIRE_THAT(puml, (IsField<Public>("comparator", "CMP")));
|
||||
|
||||
REQUIRE_THAT(puml, !IsClass(_A("E::nested_template")));
|
||||
REQUIRE_THAT(puml, IsClassTemplate("E::nested_template", "ET"));
|
||||
REQUIRE_THAT(puml, IsClassTemplate("E::nested_template", "char"));
|
||||
REQUIRE_THAT(puml,
|
||||
IsInstantiation(
|
||||
_A("E::nested_template<ET>"), _A("E::nested_template<char>")));
|
||||
|
||||
save_puml(config.output_directory() + "/" + diagram->name + ".puml", puml);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user