Skip to content

[abi] method parameter mangled as a substitution does not demangle correctly #108009

Closed
@VitaNuo

Description

@VitaNuo

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.

Metadata

Metadata

Assignees

Labels

ABIApplication Binary Interfacelibc++abilibc++abi C++ Runtime Library. Not libc++.llvmUmbrella label for LLVM issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions