-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[abi] Declaring class of a member-like friend method is not mangled. #110088
Comments
@llvm/issue-subscribers-tools-llvm-cxxfilt Author: Viktoriia Bakalova (VitaNuo)
The code sample
does not compile with the following error
The reason appears to be that the enclosing class template specialization As per the discussion in itanium-cxx-abi/cxx-abi#24 (comment), the code above is valid and the solution is to include the declaring class in the mangling. From @rjmccall on the aforementioned issue:
Note 1: gcc can compile the above snippet by including the declaring class in the mangling, which results in the mangled string Note 2: this issue stands in the way of implementing the demangling of template parameters in constraints (https://github.com/llvm/llvm-project/blob/main/libcxxabi/src/demangle/ItaniumDemangle.h#L5795). |
@llvm/issue-subscribers-clang-frontend Author: Viktoriia Bakalova (VitaNuo)
The code sample
template <class>
concept True = true;
namespace test2 {
template<typename T> struct A {
template<typename U = void>
friend void g(...) requires True<T> && True<U> {}
};
void call() {
A<int> ai;
A<bool> ab;
g(ai);
g(ab);
}
} does not compile with the following error
The reason appears to be that the enclosing class template specialization As per the discussion in itanium-cxx-abi/cxx-abi#24 (comment), the code above is valid and the solution is to include the declaring class in the mangling. From @rjmccall on the aforementioned issue:
Note 1: gcc can compile the above snippet by including the declaring class in the mangling, which results in the mangled string Note 2: this issue stands in the way of implementing the demangling of template parameters in constraints (https://github.com/llvm/llvm-project/blob/main/libcxxabi/src/demangle/ItaniumDemangle.h#L5795). |
The code sample
does not compile with the following error
The reason appears to be that the enclosing class template specialization
A<int>
(orA<bool>
, respectively) is not part of the mangled name_ZN5test2F1gIvEEvzQaa4TrueIT_E4TrueITL0__E
, resulting ing(ai)
andg(ab)
mangled as the same string.As per the discussion in itanium-cxx-abi/cxx-abi#24 (comment), the code above is valid and the solution is to include the declaring class in the mangling. From @rjmccall on the aforementioned issue:
Note 1: gcc can compile the above snippet by including the declaring class in the mangling, which results in the mangled string
_ZN5test21AIiEF1gIvEEvzQaa4TrueIT_E4TrueITL0__E
forg(ai)
(NoteAIiE
mangles the declaring class), and_ZN5test21AIbEF1gIvEEvzQaa4TrueIT_E4TrueITL0__E
forg(ab)
(NoteAIbE
mangles the declaring class).Note 2: this issue stands in the way of implementing the demangling of template parameters in constraints (https://github.com/llvm/llvm-project/blob/main/libcxxabi/src/demangle/ItaniumDemangle.h#L5795).
T_
in_ZN5test21AIiEF1gIvEEvzQaa4TrueIT_E4TrueITL0__E
is impossible to demangle, since it is a substitution for the template argument of class A that is not part of the mangling.The text was updated successfully, but these errors were encountered: