Fixed formatting
This commit is contained in:
@@ -1017,7 +1017,8 @@ void translation_unit_visitor::
|
|||||||
if (arg.getAsType()->getAs<clang::FunctionType>()) {
|
if (arg.getAsType()->getAs<clang::FunctionType>()) {
|
||||||
|
|
||||||
// for (const auto ¶m_type :
|
// for (const auto ¶m_type :
|
||||||
// arg.getAsType()->getAs<clang::FunctionProtoType>()->param_types()) {
|
// arg.getAsType()->getAs<clang::FunctionProtoType>()->param_types())
|
||||||
|
// {
|
||||||
//
|
//
|
||||||
// if (!param_type->getAs<clang::RecordType>())
|
// if (!param_type->getAs<clang::RecordType>())
|
||||||
// continue;
|
// continue;
|
||||||
@@ -1034,7 +1035,8 @@ void translation_unit_visitor::
|
|||||||
// *param_type->getAs<clang::RecordType>(),
|
// *param_type->getAs<clang::RecordType>(),
|
||||||
// diagram().should_include(
|
// diagram().should_include(
|
||||||
// full_template_specialization_name)
|
// full_template_specialization_name)
|
||||||
// ? std::make_optional(&template_instantiation)
|
// ?
|
||||||
|
// std::make_optional(&template_instantiation)
|
||||||
// : parent);
|
// : parent);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -176,9 +176,7 @@ public:
|
|||||||
clanguml::sequence_diagram::model::diagram &diagram,
|
clanguml::sequence_diagram::model::diagram &diagram,
|
||||||
const clanguml::config::sequence_diagram &config);
|
const clanguml::config::sequence_diagram &config);
|
||||||
|
|
||||||
bool shouldVisitTemplateInstantiations() {
|
bool shouldVisitTemplateInstantiations() { return true; }
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool VisitCallExpr(clang::CallExpr *expr);
|
virtual bool VisitCallExpr(clang::CallExpr *expr);
|
||||||
|
|
||||||
|
|||||||
@@ -38,13 +38,11 @@ TEST_CASE("t20004", "[test-case][sequence]")
|
|||||||
|
|
||||||
REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1<unsigned long>()"), "m1"));
|
REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1<unsigned long>()"), "m1"));
|
||||||
REQUIRE_THAT(puml,
|
REQUIRE_THAT(puml,
|
||||||
HasCall(_A("m1<unsigned long>()"), _A("m4<unsigned long>()"),
|
HasCall(_A("m1<unsigned long>()"), _A("m4<unsigned long>()"), "m4"));
|
||||||
"m4"));
|
|
||||||
|
|
||||||
REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1<std::string>()"), "m1"));
|
REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1<std::string>()"), "m1"));
|
||||||
REQUIRE_THAT(puml,
|
REQUIRE_THAT(
|
||||||
HasCall(_A("m1<std::string>()"), _A("m2<std::string>()"),
|
puml, HasCall(_A("m1<std::string>()"), _A("m2<std::string>()"), "m2"));
|
||||||
"m2"));
|
|
||||||
|
|
||||||
REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1<int>()"), "m1"));
|
REQUIRE_THAT(puml, HasCall(_A("main()"), _A("m1<int>()"), "m1"));
|
||||||
REQUIRE_THAT(puml, HasCall(_A("m1<int>()"), _A("m2<int>()"), "m2"));
|
REQUIRE_THAT(puml, HasCall(_A("m1<int>()"), _A("m2<int>()"), "m2"));
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ template <typename T> struct AA {
|
|||||||
void aa2(T t) { }
|
void aa2(T t) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename T, typename F> struct BB {
|
template <typename T, typename F> struct BB {
|
||||||
void bb1(T t, F f) { aa_.aa1(t); }
|
void bb1(T t, F f) { aa_.aa1(t); }
|
||||||
void bb2(T t, F f) { aa_.aa2(t); }
|
void bb2(T t, F f) { aa_.aa2(t); }
|
||||||
@@ -38,7 +37,6 @@ template <typename T> struct BB<T, std::string> {
|
|||||||
AA<T> aa_;
|
AA<T> aa_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void tmain()
|
void tmain()
|
||||||
{
|
{
|
||||||
B<int> bint;
|
B<int> bint;
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
#include <type_traits>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
namespace clanguml {
|
namespace clanguml {
|
||||||
namespace t20008
|
namespace t20008 {
|
||||||
{
|
|
||||||
|
|
||||||
template <typename T> struct A {
|
template <typename T> struct A {
|
||||||
void a1(T arg) { }
|
void a1(T arg) { }
|
||||||
@@ -14,7 +13,8 @@ template <typename T> struct A {
|
|||||||
template <typename T> struct B {
|
template <typename T> struct B {
|
||||||
A<T> a;
|
A<T> a;
|
||||||
|
|
||||||
void b(T arg) {
|
void b(T arg)
|
||||||
|
{
|
||||||
if constexpr (std::is_integral_v<T>) {
|
if constexpr (std::is_integral_v<T>) {
|
||||||
a.a1(arg);
|
a.a1(arg);
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@ template <typename T> struct B {
|
|||||||
else {
|
else {
|
||||||
a.a3(arg);
|
a.a3(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void tmain() {
|
void tmain()
|
||||||
|
{
|
||||||
using namespace std::string_literals;
|
using namespace std::string_literals;
|
||||||
|
|
||||||
B<int> bint;
|
B<int> bint;
|
||||||
|
|||||||
@@ -79,19 +79,26 @@ template <typename T, typename... Ts> constexpr bool has_type() noexcept
|
|||||||
return (std::is_same_v<T, Ts> || ... || false);
|
return (std::is_same_v<T, Ts> || ... || false);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Public { };
|
struct Public {
|
||||||
|
};
|
||||||
|
|
||||||
struct Protected { };
|
struct Protected {
|
||||||
|
};
|
||||||
|
|
||||||
struct Private { };
|
struct Private {
|
||||||
|
};
|
||||||
|
|
||||||
struct Abstract { };
|
struct Abstract {
|
||||||
|
};
|
||||||
|
|
||||||
struct Static { };
|
struct Static {
|
||||||
|
};
|
||||||
|
|
||||||
struct Const { };
|
struct Const {
|
||||||
|
};
|
||||||
|
|
||||||
struct Default { };
|
struct Default {
|
||||||
|
};
|
||||||
|
|
||||||
struct HasCallWithResultMatcher : ContainsMatcher {
|
struct HasCallWithResultMatcher : ContainsMatcher {
|
||||||
HasCallWithResultMatcher(
|
HasCallWithResultMatcher(
|
||||||
|
|||||||
Reference in New Issue
Block a user