As seen in https://github.com/llvm/llvm-project/issues/51854 llvm-cxxfilt was having trouble demangling the case below:
When attempting to demangle "_Z1fIDnLDn0EEvv" llvm-cxxfilt does not demangle the input. According to GCC we should see similar to "void f<decltype(nullptr), (decltype(nullptr))0>()"
After investigating the issue I discovered the following in the Itanium C++ ABI demangling section:
The pointer literal expression nullptr is encoded as "LDnE". In contrast, a template argument which happens to be a null pointer (an extension made standard in C++11) is mangled as if it were a literal 0 of the appropriate pointer type; for example, "LPi0E" or "LDn0E". This inconsistency is an unfortunate accident.
We handle the "LDNE" case and "LPi0E" but not "LDn0E". This change adds that handling.
Why demangle this differently to just 'nullptr'? I notice GNU's demangler does that:
It would seem
would suffice?