templated type alias not recognized
jobor opened this issue · comments
Consider the following code
template<typename T>
struct Foo
{
};
template<typename T> using Bar = Foo<T>;
int main()
{
Foo<int> foo = {};
Bar<int> bar = {};
// break here and hover over foo and bar.
return 0;
}
with this natvis file
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="Foo<*>">
<DisplayString>this is a Foo</DisplayString>
</Type>
</AutoVisualizer>
then cppdbg with gcc on Linux will be able to display the content of foo
as this is a Foo
, but it displays the default visualizer for bar
.
Expected result: display this is a Foo
for bar
as well.
Adding <AlternativeType Name="Bar<*>">
to the Foo
type does not work.
Adding a separate <Type Name="Bar<*>">
does not work.
Adding a separate <Type Name="Bar">
does work. However, I loose the information about the template parameters. I can't access $T1
anymore.
Side note / trivia: with cppvsdbg, this is a Foo
is displayed for bar
- also if the entry for Bar
is missing in the natvis file.
More trivia: this contrived example stems from an attempt to display Qt's type QVector
which is defined as template <typename T> using QVector = QList<T>
.