forked from OSchip/llvm-project
[AST] Add more testcases to QualTypeNamesTest. NFC
These all currently pass, but are tricky cases not currently covered. https://reviews.llvm.org/D114251 would break them in its current state.
This commit is contained in:
parent
32dede65ae
commit
62bcb75ce5
|
@ -92,6 +92,9 @@ TEST(QualTypeNameTest, getFullyQualifiedName) {
|
||||||
"OuterTemplateClass<A::B::Class0>::Inner";
|
"OuterTemplateClass<A::B::Class0>::Inner";
|
||||||
Visitor.ExpectedQualTypeNames["CheckM"] = "const A::B::Class0 *";
|
Visitor.ExpectedQualTypeNames["CheckM"] = "const A::B::Class0 *";
|
||||||
Visitor.ExpectedQualTypeNames["CheckN"] = "const X *";
|
Visitor.ExpectedQualTypeNames["CheckN"] = "const X *";
|
||||||
|
Visitor.ExpectedQualTypeNames["ttp_using"] =
|
||||||
|
"OuterTemplateClass<A::B::Class0>";
|
||||||
|
Visitor.ExpectedQualTypeNames["alias_of_template"] = "ABTemplate0IntInt";
|
||||||
Visitor.runOver(
|
Visitor.runOver(
|
||||||
"int CheckInt;\n"
|
"int CheckInt;\n"
|
||||||
"template <typename T>\n"
|
"template <typename T>\n"
|
||||||
|
@ -124,6 +127,9 @@ TEST(QualTypeNameTest, getFullyQualifiedName) {
|
||||||
"}\n"
|
"}\n"
|
||||||
"using A::B::Class0;\n"
|
"using A::B::Class0;\n"
|
||||||
"void Function(Class0 CheckF);\n"
|
"void Function(Class0 CheckF);\n"
|
||||||
|
"OuterTemplateClass<Class0> ttp_using;\n"
|
||||||
|
"using ABTemplate0IntInt = A::B::Template0<int, int>;\n"
|
||||||
|
"void Function(ABTemplate0IntInt alias_of_template);\n"
|
||||||
"using namespace A::B::C;\n"
|
"using namespace A::B::C;\n"
|
||||||
"void Function(MyInt CheckG);\n"
|
"void Function(MyInt CheckG);\n"
|
||||||
"void f() {\n"
|
"void f() {\n"
|
||||||
|
@ -182,6 +188,25 @@ TEST(QualTypeNameTest, getFullyQualifiedName) {
|
||||||
" struct A { typedef int X; };"
|
" struct A { typedef int X; };"
|
||||||
"}");
|
"}");
|
||||||
|
|
||||||
|
TypeNameVisitor DoubleUsing;
|
||||||
|
DoubleUsing.ExpectedQualTypeNames["direct"] = "a::A<0>";
|
||||||
|
DoubleUsing.ExpectedQualTypeNames["indirect"] = "b::B";
|
||||||
|
DoubleUsing.ExpectedQualTypeNames["double_indirect"] = "b::B";
|
||||||
|
DoubleUsing.runOver(R"cpp(
|
||||||
|
namespace a {
|
||||||
|
template<int> class A {};
|
||||||
|
A<0> direct;
|
||||||
|
}
|
||||||
|
namespace b {
|
||||||
|
using B = ::a::A<0>;
|
||||||
|
B indirect;
|
||||||
|
}
|
||||||
|
namespace b {
|
||||||
|
using ::b::B;
|
||||||
|
B double_indirect;
|
||||||
|
}
|
||||||
|
)cpp");
|
||||||
|
|
||||||
TypeNameVisitor GlobalNsPrefix;
|
TypeNameVisitor GlobalNsPrefix;
|
||||||
GlobalNsPrefix.WithGlobalNsPrefix = true;
|
GlobalNsPrefix.WithGlobalNsPrefix = true;
|
||||||
GlobalNsPrefix.ExpectedQualTypeNames["IntVal"] = "int";
|
GlobalNsPrefix.ExpectedQualTypeNames["IntVal"] = "int";
|
||||||
|
|
Loading…
Reference in New Issue