diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-05-18 21:52:26 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-05-18 21:52:26 +0000 |
commit | 76509b128634a98098406f0446ed952285decac7 (patch) | |
tree | f902a8b1ec7b2b79f69a6468834264f32c5db720 /libiberty | |
parent | e6481cd19b12cc096803c553bf7fbcd4c251c6bc (diff) | |
download | gcc-76509b128634a98098406f0446ed952285decac7.tar.gz |
* cplus-dem.c (enum type_kind_t): Add tk_rvalue_reference
constant.
(demangle_template_value_parm): Handle tk_rvalue_reference
type kind.
(do_type): Support 'O' type id (rvalue references).
* testsuite/demangle-expected: Add tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 10 | ||||
-rw-r--r-- | libiberty/cplus-dem.c | 13 | ||||
-rw-r--r-- | libiberty/testsuite/demangle-expected | 115 |
3 files changed, 136 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 1407cd3ff98..25597967b2d 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,13 @@ +2016-05-18 Artemiy Volkov <artemiyv@acm.org> + + * cplus-dem.c (enum type_kind_t): Add tk_rvalue_reference + constant. + (demangle_template_value_parm): Handle tk_rvalue_reference + type kind. + (do_type): Support 'O' type id (rvalue references). + + * testsuite/demangle-expected: Add tests. + 2016-05-02 Marcel Böhme <boehme.marcel@gmail.com> PR c++/70498 diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c index 7514e57913c..d04c32a904a 100644 --- a/libiberty/cplus-dem.c +++ b/libiberty/cplus-dem.c @@ -244,6 +244,7 @@ typedef enum type_kind_t tk_none, tk_pointer, tk_reference, + tk_rvalue_reference, tk_integral, tk_bool, tk_char, @@ -2042,7 +2043,8 @@ demangle_template_value_parm (struct work_stuff *work, const char **mangled, } else if (tk == tk_real) success = demangle_real_value (work, mangled, s); - else if (tk == tk_pointer || tk == tk_reference) + else if (tk == tk_pointer || tk == tk_reference + || tk == tk_rvalue_reference) { if (**mangled == 'Q') success = demangle_qualified (work, mangled, s, @@ -3588,6 +3590,14 @@ do_type (struct work_stuff *work, const char **mangled, string *result) tk = tk_reference; break; + /* An rvalue reference type */ + case 'O': + (*mangled)++; + string_prepend (&decl, "&&"); + if (tk == tk_none) + tk = tk_rvalue_reference; + break; + /* An array */ case 'A': { @@ -3645,7 +3655,6 @@ do_type (struct work_stuff *work, const char **mangled, string *result) break; case 'M': - case 'O': { type_quals = TYPE_UNQUALIFIED; diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index d124261121f..62ab18ca37d 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -31,6 +31,11 @@ ArrowLine::ArrowheadIntersects(Arrowhead *, BoxObj &, Graphic *) ArrowLine::ArrowheadIntersects # --format=gnu --no-params +ArrowheadIntersects__9ArrowLineP9ArrowheadO6BoxObjP7Graphic +ArrowLine::ArrowheadIntersects(Arrowhead *, BoxObj &&, Graphic *) +ArrowLine::ArrowheadIntersects +# +--format=gnu --no-params AtEnd__13ivRubberGroup ivRubberGroup::AtEnd(void) ivRubberGroup::AtEnd @@ -51,6 +56,11 @@ TextCode::CoreConstDecls(ostream &) TextCode::CoreConstDecls # --format=gnu --no-params +CoreConstDecls__8TextCodeO7ostream +TextCode::CoreConstDecls(ostream &&) +TextCode::CoreConstDecls +# +--format=gnu --no-params Detach__8StateVarP12StateVarView StateVar::Detach(StateVarView *) StateVar::Detach @@ -66,21 +76,41 @@ RelateManip::Effect(ivEvent &) RelateManip::Effect # --format=gnu --no-params +Effect__11RelateManipO7ivEvent +RelateManip::Effect(ivEvent &&) +RelateManip::Effect +# +--format=gnu --no-params FindFixed__FRP4CNetP4CNet FindFixed(CNet *&, CNet *) FindFixed # --format=gnu --no-params +FindFixed__FOP4CNetP4CNet +FindFixed(CNet *&&, CNet *) +FindFixed +# +--format=gnu --no-params Fix48_abort__FR8twolongs Fix48_abort(twolongs &) Fix48_abort # --format=gnu --no-params +Fix48_abort__FO8twolongs +Fix48_abort(twolongs &&) +Fix48_abort +# +--format=gnu --no-params GetBarInfo__15iv2_6_VScrollerP13ivPerspectiveRiT2 iv2_6_VScroller::GetBarInfo(ivPerspective *, int &, int &) iv2_6_VScroller::GetBarInfo # --format=gnu --no-params +GetBarInfo__15iv2_6_VScrollerP13ivPerspectiveOiT2 +iv2_6_VScroller::GetBarInfo(ivPerspective *, int &&, int &&) +iv2_6_VScroller::GetBarInfo +# +--format=gnu --no-params GetBgColor__C9ivPainter ivPainter::GetBgColor(void) const ivPainter::GetBgColor @@ -986,11 +1016,21 @@ List<VHDLEntity>::Pix::Pix(List<VHDLEntity>::Pix const &) List<VHDLEntity>::Pix::Pix # --format=gnu --no-params +__Q2t4List1Z10VHDLEntity3PixOCQ2t4List1Z10VHDLEntity3Pix +List<VHDLEntity>::Pix::Pix(List<VHDLEntity>::Pix const &&) +List<VHDLEntity>::Pix::Pix +# +--format=gnu --no-params __Q2t4List1Z10VHDLEntity7elementRC10VHDLEntityPT0 List<VHDLEntity>::element::element(VHDLEntity const &, List<VHDLEntity>::element *) List<VHDLEntity>::element::element # --format=gnu --no-params +__Q2t4List1Z10VHDLEntity7elementOC10VHDLEntityPT0 +List<VHDLEntity>::element::element(VHDLEntity const &&, List<VHDLEntity>::element *) +List<VHDLEntity>::element::element +# +--format=gnu --no-params __Q2t4List1Z10VHDLEntity7elementRCQ2t4List1Z10VHDLEntity7element List<VHDLEntity>::element::element(List<VHDLEntity>::element const &) List<VHDLEntity>::element::element @@ -1036,6 +1076,11 @@ PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(PixX<VHDLLibrary, VHD PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX # --format=gnu --no-params +__t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntityOCt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity +PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > const &&) +PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX +# +--format=gnu --no-params nextE__C11VHDLLibraryRt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity VHDLLibrary::nextE(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > &) const VHDLLibrary::nextE @@ -1261,6 +1306,11 @@ smanip_int::smanip_int(ios &(*)(ios &, int), int) smanip_int::smanip_int # --format=lucid --no-params +__ct__10smanip_intFPFO3iosi_O3iosi +smanip_int::smanip_int(ios &&(*)(ios &&, int), int) +smanip_int::smanip_int +# +--format=lucid --no-params __ct__11fstreambaseFi fstreambase::fstreambase(int) fstreambase::fstreambase @@ -1281,6 +1331,11 @@ smanip_long::smanip_long(ios &(*)(ios &, long), long) smanip_long::smanip_long # --format=lucid --no-params +__ct__11smanip_longFPFO3iosl_O3iosl +smanip_long::smanip_long(ios &&(*)(ios &&, long), long) +smanip_long::smanip_long +# +--format=lucid --no-params __ct__11stdiostreamFP4FILE stdiostream::stdiostream(FILE *) stdiostream::stdiostream @@ -1321,6 +1376,11 @@ foo::foo(foo &) foo::foo # --format=lucid --no-params +__ct__3fooFO3foo +foo::foo(foo &&) +foo::foo +# +--format=lucid --no-params __ct__3fooFi foo::foo(int) foo::foo @@ -1336,6 +1396,11 @@ foo::foo(int, foo &, int, foo &, int, foo &) foo::foo # --format=lucid --no-params +__ct__3fooFiO3fooT1T2T1T2 +foo::foo(int, foo &&, int, foo &&, int, foo &&) +foo::foo +# +--format=lucid --no-params __ct__3iosFP9streambuf ios::ios(streambuf *) ios::ios @@ -1811,6 +1876,11 @@ foo(int, foo &, int, foo &, int, foo &) foo # --format=lucid --no-params +foo__FiO3fooT1T2T1T2 +foo(int, foo &&, int, foo &&, int, foo &&) +foo +# +--format=lucid --no-params foo___3barFl bar::foo_(long) bar::foo_ @@ -2561,6 +2631,11 @@ DListNode<RLabel &>::DListNode(RLabel &, DListNode<RLabel &> *, DListNode<RLabel DListNode<RLabel &>::DListNode # --format=arm --no-params +__ct__25DListNode__pt__9_O6RLabelFO6RLabelP25DListNode__pt__9_O6RLabelT2 +DListNode<RLabel &&>::DListNode(RLabel &&, DListNode<RLabel &&> *, DListNode<RLabel &&> *) +DListNode<RLabel &&>::DListNode +# +--format=arm --no-params bar__3fooFiT16FooBar foo::bar(int, int, FooBar) foo::bar @@ -2991,6 +3066,11 @@ DListNode<RLabel &>::DListNode(RLabel &, DListNode<RLabel &> *, DListNode<RLabel DListNode<RLabel &>::DListNode # --format=hp --no-params +__ct__9DListNodeXTO6RLabel__FO6RLabelP9DListNodeXTO6RLabel_T2 +DListNode<RLabel &&>::DListNode(RLabel &&, DListNode<RLabel &&> *, DListNode<RLabel &&> *) +DListNode<RLabel &&>::DListNode +# +--format=hp --no-params elem__6vectorXTiUP34__Fi vector<int,34U>::elem(int) vector<int,34U>::elem @@ -3021,16 +3101,31 @@ vector<int,-67,4000U,short &>::elem(int) vector<int,-67,4000U,short &>::elem # --format=hp --no-params +elem__6vectorXTiSN67UP4000TOs__Fi +vector<int,-67,4000U,short &&>::elem(int) +vector<int,-67,4000U,short &&>::elem +# +--format=hp --no-params elem__6vectorXTiSN67TRdTFPv_i__Fi vector<int,-67,double &,int (void *)>::elem(int) vector<int,-67,double &,int (void *)>::elem # --format=hp --no-params +elem__6vectorXTiSN67TOdTFPv_i__Fi +vector<int,-67,double &&,int (void *)>::elem(int) +vector<int,-67,double &&,int (void *)>::elem +# +--format=hp --no-params X__6vectorXTiSN67TdTPvUP5TRs vector<int,-67,double,void *,5U,short &>::X vector<int,-67,double,void *,5U,short &>::X # --format=hp --no-params +X__6vectorXTiSN67TdTPvUP5TOs +vector<int,-67,double,void *,5U,short &&>::X +vector<int,-67,double,void *,5U,short &&>::X +# +--format=hp --no-params elem__6vectorXTiA3foo__Fi vector<int,&foo>::elem(int) vector<int,&foo>::elem @@ -3071,6 +3166,11 @@ Spec<int,int &,int>::spec(int *) Spec<int,int &,int>::spec # --format=hp --no-params +spec__17Spec<#1,#1.&&,#1>XTiTOiTi_FPi +Spec<int,int &&,int>::spec(int *) +Spec<int,int &&,int>::spec +# +--format=hp --no-params add__XTc_FcT1 add<char>(char, char) add<char> @@ -3101,6 +3201,11 @@ C<Test, Test::output> call<Test>(Test &) C<Test, Test::output> call<Test> # --format=gnu --no-params +call__H1Z4Test_OX01_t1C2ZX01PMX01FPX01i_vQ2X016output +C<Test, Test::output> call<Test>(Test &&) +C<Test, Test::output> call<Test> +# +--format=gnu --no-params fn__FPQ21n1cPMQ21n1cFPQ21n1c_i fn(n::c *, int (n::c::*)(n::c *)) fn @@ -3126,6 +3231,11 @@ int foo<TA<int const &, NA<9> > >(TA<int const &, NA<9> >) int foo<TA<int const &, NA<9> > > # --format=gnu --no-params +foo__H1Zt2TA2ZOCiZt2NA1Ui9_X01_i +int foo<TA<int const &&, NA<9> > >(TA<int const &&, NA<9> >) +int foo<TA<int const &&, NA<9> > > +# +--format=gnu --no-params foo__H1Zt2TA2ZcZt2NA1Ui20_X01_i int foo<TA<char, NA<20> > >(TA<char, NA<20> >) int foo<TA<char, NA<20> > > @@ -3402,6 +3512,11 @@ int* const volatile restrict _far _Z3fooILi2EEvRAplT_Li1E_i void foo<2>(int (&) [(2)+(1)]) foo<2> +# +--format=gnu-v3 --no-params +_Z3fooILi2EEvOAplT_Li1E_i +void foo<2>(int (&&) [(2)+(1)]) +foo<2> # --format=gnu-v3 --no-params _Z1fM1AKFvvE |