diff options
author | Nathan Sidwell <nathan@acm.org> | 2022-09-30 12:11:42 -0700 |
---|---|---|
committer | Nathan Sidwell <nathan@acm.org> | 2022-10-07 09:12:01 -0700 |
commit | eb491ea5c10955c667ceeda76dede393c93a377b (patch) | |
tree | 16f99249432a5217c504c73e9ceb05d454ea90e1 /libiberty/testsuite | |
parent | f7f4628054358a92a55d52645cf107aa26ff6765 (diff) | |
download | gcc-eb491ea5c10955c667ceeda76dede393c93a377b.zip gcc-eb491ea5c10955c667ceeda76dede393c93a377b.tar.gz gcc-eb491ea5c10955c667ceeda76dede393c93a377b.tar.bz2 |
libiberty: Demangle variadic template lambdas
Now we have templated lambdas, we can have variadic template lambdas,
and this leads to lambda signatures containing parameter packs. But
just like 'auto' inside such a signature, we don't have a containing
template, and thus fail. The fix is to check is_lambda_arg, just as
for a template parameter. This allows us to demangle g++'s manglings
of such lambdas.
It's not a totally accurate demangling, because we don't mangle the
template head (that's a separate issue), but it is better than failing
to demangle.
Due to the way we print subexprs, we add an unnecessary parens around
the argument of the pack. That's an orthogonal problem, for which the
solution is to have better knowledge of operator precedence.
libiberty/
* cp-demangle.c (d_print_comp_inner): Allow parameter packs
in a lambda signature.
* testsuite/demangle-expected: Add tests.
Diffstat (limited to 'libiberty/testsuite')
-rw-r--r-- | libiberty/testsuite/demangle-expected | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 8fad689..90dd4a1 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -1574,3 +1574,10 @@ initializer for module Foo.Bar _ZGIW3FooWP3BarW3Baz initializer for module Foo:Bar.Baz + +_ZZ2L1vENKUlDpT_E_clIJiPiEEEvS0_ +void L1()::{lambda((auto:1)...)#1}::operator()<int, int*>(int, int*) const + +_ZZ2L1vENKUlDpT_E_clIJiPiEEEDaS0_ +auto L1()::{lambda((auto:1)...)#1}::operator()<int, int*>(int, int*) const + |