Created attachment 21441
Tooling implementation that shows the bug, with patch compile script and
example.
A function call to getFullyQualifiedType with a dependent name type is not
resolved correctly.
For the definition of:
namespace name {
template<typename T>
struct AB {
struct Test {
using Type = T;
};
AB() {}
void func(Test a, typename Test::Type b) {}
};
}
The arguments of func are resolved to:
Parameter: a
Full qual type: name::AB<T>::Test
Parameter: b
Full qual type: typename Test::Type
I tried to find the error and could get a partial patch:
--- a/QualTypeNames.cpp 2019-02-06 14:50:37.169581290 +0100
+++ b/QualTypeNames.cpp 2019-02-06 14:53:08.114611002 +0100
@@ -326,6 +326,8 @@
Decl = TagDeclType->getDecl();
} else if (const auto *TST = dyn_cast<TemplateSpecializationType>(TypePtr)) {
Decl = TST->getTemplateName().getAsTemplateDecl();
+ } else if (const auto *DNT = dyn_cast<DependentNameType>(TypePtr)) {
+ Decl = DNT->getQualifier()->getAsRecordDecl();
} else {
Decl = TypePtr->getAsCXXRecordDecl();
}
With this Patch the result is now:
Parameter: a
Full qual type: name::AB<T>::Test
Parameter: b
Full qual type: name::AB<T>::typename Test::Type
I could not get how to convert the DependentNameType to a regular type.
The expected result would be:
Parameter: a
Full qual type: name::AB<T>::Test
Parameter: b
Full qual type: typename name::AB<T>::Test::Type
Find attached the compile script, the example file, the patch and the tooling
implementation which shows the bug.
fullNameBug.tar
(71680 bytes, application/x-tar)