re PR other/78252 (C++ demangler crashes with infinite recursion with lambda (auto))
authorNathan Sidwell <nathan@acm.org>
Mon, 12 Dec 2016 17:00:37 +0000 (17:00 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Mon, 12 Dec 2016 17:00:37 +0000 (17:00 +0000)
commit8e09a726e62c6ade9ea25e1f1a9269141ce73e81
tree5ef5a0b7cfb58687079b847ea9b92a24032c250c
parentb8cab8a5492e9639fc9f0ff23f5c392ac395e8a2
re PR other/78252 (C++ demangler crashes with infinite recursion with lambda (auto))

libiberty/
PR c++/78252
* cp-demangle.c (struct d_print_info): Add is_lambda_arg field.
(d_print_init): Initialize it.
(d_print_comp_inner) <DEMANGLE_COMPONENT_TEMPLATE_PARAM>: Check
is_lambda_arg for auto.
<DEMANGLE_COMPONENT_REFERENCE,
DEMANGLE_COMPONENT_RVALUE_REFERENCE>: Skip smashing check when
is_lambda_arg.
<DEMANGLE_COMPONENT_LAMBDA>: Increment is_lambda_arg around arg
printing.
* testsuite/demangle-expected: Add lambda auto mangling cases.

gcc/testsuite/
PR c++/78252
* g++.dg/cpp1y/lambda-mangle-1.C: New.

From-SVN: r243566
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/lambda-mangle-1.C [new file with mode: 0644]
libiberty/ChangeLog
libiberty/cp-demangle.c
libiberty/testsuite/demangle-expected