Implement demangling support for C++20 lambda expression extensions.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 6 Sep 2019 23:53:21 +0000 (23:53 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 6 Sep 2019 23:53:21 +0000 (23:53 +0000)
commit4bbe85c5d4e7535a55e3455de310868067d0182a
tree35f8b1a4265a2ee29610ff5a1577ea265718681e
parent28328c3771e4241366ecb7aba8963dc92b3065d7
Implement demangling support for C++20 lambda expression extensions.

This implements demangling support for the mangling extensions specified
in https://github.com/itanium-cxx-abi/cxx-abi/pull/85, much of which is
implemented in Clang r359967 and r371004.

Specifically, this provides demangling for:

 * <template-param-decl> in <lambda-sig>
 * <template-param> with non-zero level
 * lambda-expression literals (not emitted by Clang yet)
 * nullptr literals
 * string literals

(The final two seem unrelated, but handling them was necessary in order
to disambiguate between lambda expressions and the other forms of
literal for which we have a type but no value.)

When demangling a <lambda-sig>, we form template parameters with no
corresponding argument, so we cannot substitute in the argument in the
demangling. Instead we invent synthetic names for the template
parameters (eg, '[]<typename $T>($T *x)').

llvm-svn: 371273
libcxxabi/src/cxa_demangle.cpp
libcxxabi/src/demangle/ItaniumDemangle.h
libcxxabi/test/test_demangle.pass.cpp