diff options
author | Jason Merrill <jason@redhat.com> | 2013-02-14 20:26:44 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2013-02-14 20:26:44 -0500 |
commit | 622aac0b88ed111d033a950b0737317d8c85bbcb (patch) | |
tree | 76ab66221ec193a48645ec9dfa45c26964b7f963 /libiberty | |
parent | ff9b4073cc6f8da73fd9affa494192e91c852e64 (diff) | |
download | gcc-622aac0b88ed111d033a950b0737317d8c85bbcb.zip gcc-622aac0b88ed111d033a950b0737317d8c85bbcb.tar.gz gcc-622aac0b88ed111d033a950b0737317d8c85bbcb.tar.bz2 |
re PR c++/55223 ([C++11] Default lambda expression of a templated class member)
PR c++/55223
gcc/cp/
* pt.c (tsubst_copy_and_build) [LAMBDA_EXPR]: Fix handling of
default argument scope.
* mangle.c (write_name): Likewise.
libiberty/
* cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_DEFAULT_ARG.
(d_print_comp): Likewise.
From-SVN: r196065
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 5 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 21 | ||||
-rw-r--r-- | libiberty/testsuite/demangle-expected | 3 |
3 files changed, 28 insertions, 1 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index d7f1fd0..7935ad6 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2013-02-14 Jason Merrill <jason@redhat.com> + + * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_DEFAULT_ARG. + (d_print_comp): Likewise. + 2013-02-09 Jakub Jelinek <jakub@redhat.com> PR other/56245 diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 913d4bf..39be031 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -707,6 +707,14 @@ d_dump (struct demangle_component *dc, int indent) case DEMANGLE_COMPONENT_TLS_WRAPPER: printf ("tls wrapper function\n"); break; + case DEMANGLE_COMPONENT_DEFAULT_ARG: + printf ("default argument %d\n", dc->u.s_unary_num.num); + d_dump (dc->u.s_unary_num.sub, indent+2); + return; + case DEMANGLE_COMPONENT_LAMBDA: + printf ("lambda %d\n", dc->u.s_unary_num.num); + d_dump (dc->u.s_unary_num.sub, indent+2); + return; } d_dump (d_left (dc), indent + 2); @@ -3168,6 +3176,7 @@ d_expr_primary (struct d_info *di) /* <local-name> ::= Z <(function) encoding> E <(entity) name> [<discriminator>] ::= Z <(function) encoding> E s [<discriminator>] + ::= Z <(function) encoding> E d [<parameter> number>] _ <entity name> */ static struct demangle_component * @@ -3869,7 +3878,17 @@ d_print_comp (struct d_print_info *dpi, int options, d_append_string (dpi, "::"); else d_append_char (dpi, '.'); - d_print_comp (dpi, options, d_right (dc)); + { + struct demangle_component *local_name = d_right (dc); + if (local_name->type == DEMANGLE_COMPONENT_DEFAULT_ARG) + { + d_append_string (dpi, "{default arg#"); + d_append_num (dpi, local_name->u.s_unary_num.num + 1); + d_append_string (dpi, "}::"); + local_name = local_name->u.s_unary_num.sub; + } + d_print_comp (dpi, options, local_name); + } return; case DEMANGLE_COMPONENT_TYPED_NAME: diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 5b41b03..17eacaa 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -3951,6 +3951,9 @@ S::f(int, int)::{default arg#2}::{lambda()#2}::operator()() const _ZNK1SIiE1xMUlvE1_clEv S<int>::x::{lambda()#3}::operator()() const --format=gnu-v3 +_ZN8functionC1IZN1CIiE4testES_Ed_UliE_EET_ +function::function<C<int>::test(function)::{default arg#1}::{lambda(int)#1}>(C<int>::test(function)::{default arg#1}::{lambda(int)#1}) +--format=gnu-v3 _Z1fN1SUt_E f(S::{unnamed type#1}) --format=gnu-v3 |