Closed
Description
While fiddling with the LLVM demangler, I noticed that in the following example
template <typename T>
struct Bar{};
template <typename K>
struct Foo {
template <typename T, template<typename U> typename S>
void method(S<T> t, S<K> k);
};
void s() {
Foo<int> k;
Bar<int> i;
Bar<bool> b;
k.method(b, i);
}
the call k.method(b, i)
is mangled as _ZN3FooIiE6methodIb3BarEEvT0_IT_ES3_IiE
, which appears right (Foo<int>::method<bool, Bar>(Bar<bool>, Bar<int>)
).
However, running the demangler
llvm-cxxfilt -n _ZN3FooIiE6methodIb3BarEEvT0_IT_ES3_IiE
produces void Foo<int>::method<bool, Bar>(Bar<bool>, bool<int>)
.
bool<int>
is obviously wrong and seems to stem from the S3_
substitution.