| 1 |
// Copyright 2015 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
package demangle |
| 6 |
|
| 7 |
import ( |
| 8 |
"strconv" |
| 9 |
"strings" |
| 10 |
"testing" |
| 11 |
) |
| 12 |
|
| 13 |
// demanglerTests is tests for TestDemangler. |
| 14 |
var demanglerTests = []struct { |
| 15 |
input string |
| 16 |
want string |
| 17 |
wantNoParams string |
| 18 |
wantNoTemplateParams string |
| 19 |
wantNoEnclosingParams string |
| 20 |
wantMinimal string |
| 21 |
}{ |
| 22 |
{ |
| 23 |
"_ZNSaIcEC1ERKS_", |
| 24 |
"std::allocator<char>::allocator(std::allocator<char> const&)", |
| 25 |
"std::allocator<char>::allocator", |
| 26 |
"std::allocator::allocator(std::allocator const&)", |
| 27 |
"std::allocator<char>::allocator(std::allocator<char> const&)", |
| 28 |
"std::allocator::allocator", |
| 29 |
}, |
| 30 |
{ |
| 31 |
"_ZN9__gnu_cxx13stdio_filebufIcSt11char_traitsIcEEC1EP8_IO_FILESt13_Ios_Openmodem", |
| 32 |
"__gnu_cxx::stdio_filebuf<char, std::char_traits<char> >::stdio_filebuf(_IO_FILE*, std::_Ios_Openmode, unsigned long)", |
| 33 |
"__gnu_cxx::stdio_filebuf<char, std::char_traits<char> >::stdio_filebuf", |
| 34 |
"__gnu_cxx::stdio_filebuf::stdio_filebuf(_IO_FILE*, std::_Ios_Openmode, unsigned long)", |
| 35 |
"__gnu_cxx::stdio_filebuf<char, std::char_traits<char> >::stdio_filebuf(_IO_FILE*, std::_Ios_Openmode, unsigned long)", |
| 36 |
"__gnu_cxx::stdio_filebuf::stdio_filebuf", |
| 37 |
}, |
| 38 |
{ |
| 39 |
"_ZN1n1CcvNS_1DIT_EEI1EEEv", |
| 40 |
"n::C::operator n::D<E><E>()", |
| 41 |
"n::C::operator n::D<E><E>", |
| 42 |
"n::C::operator n::D()", |
| 43 |
"n::C::operator n::D<E><E>()", |
| 44 |
"n::C::operator n::D", |
| 45 |
}, |
| 46 |
{ |
| 47 |
"_Z1CIvPN1D1E1FIdJEEEdEPN1GILb0ET_T0_T1_E1HEPFS6_S7_S8_EN1H1I1JIS7_E1KENSG_IS8_E1KE", |
| 48 |
"G<false, void, D::E::F<double>*, double>::H* C<void, D::E::F<double>*, double>(void (*)(D::E::F<double>*, double), H::I::J<D::E::F<double>*>::K, H::I::J<double>::K)", |
| 49 |
"C<void, D::E::F<double>*, double>", |
| 50 |
"G::H* C(void (*)(D::E::F*, double), H::I::J::K, H::I::J::K)", |
| 51 |
"G<false, void, D::E::F<double>*, double>::H* C<void, D::E::F<double>*, double>(void (*)(D::E::F<double>*, double), H::I::J<D::E::F<double>*>::K, H::I::J<double>::K)", |
| 52 |
"C", |
| 53 |
}, |
| 54 |
{ |
| 55 |
"_ZZNK1CI1DIcSt1EIcESaIcEEJEE1FEvE1F", |
| 56 |
"C<D<char, std::E<char>, std::allocator<char> > >::F() const::F", |
| 57 |
"C<D<char, std::E<char>, std::allocator<char> > >::F() const::F", |
| 58 |
"C::F() const::F", |
| 59 |
"C<D<char, std::E<char>, std::allocator<char> > >::F() const::F", |
| 60 |
"C::F() const::F", |
| 61 |
}, |
| 62 |
{ |
| 63 |
"_ZN1CI1DSt1EIK1FN1G1HEEE1I1JIJRKS6_EEEvDpOT_", |
| 64 |
"void C<D, std::E<F const, G::H> >::I::J<std::E<F const, G::H> const&>(std::E<F const, G::H> const&)", |
| 65 |
"C<D, std::E<F const, G::H> >::I::J<std::E<F const, G::H> const&>", |
| 66 |
"void C::I::J(std::E const&)", |
| 67 |
"void C<D, std::E<F const, G::H> >::I::J<std::E<F const, G::H> const&>(std::E<F const, G::H> const&)", |
| 68 |
"C::I::J", |
| 69 |
}, |
| 70 |
{ |
| 71 |
"_ZN1C1D1E1FIJEEEvi1GDpT_", |
| 72 |
"void C::D::E::F<>(int, G)", |
| 73 |
"C::D::E::F<>", |
| 74 |
"void C::D::E::F(int, G)", |
| 75 |
"void C::D::E::F<>(int, G)", |
| 76 |
"C::D::E::F", |
| 77 |
}, |
| 78 |
{ |
| 79 |
"_ZN1CILj50ELb1EE1DEv", |
| 80 |
"C<50u, true>::D()", |
| 81 |
"C<50u, true>::D", |
| 82 |
"C::D()", |
| 83 |
"C<50u, true>::D()", |
| 84 |
"C::D", |
| 85 |
}, |
| 86 |
{ |
| 87 |
"_ZN1CUt_C2Ev", |
| 88 |
"C::{unnamed type#1}::{unnamed type#1}()", |
| 89 |
"C::{unnamed type#1}::{unnamed type#1}", |
| 90 |
"C::{unnamed type#1}::{unnamed type#1}()", |
| 91 |
"C::{unnamed type#1}::{unnamed type#1}()", |
| 92 |
"C::{unnamed type#1}::{unnamed type#1}", |
| 93 |
}, |
| 94 |
{ |
| 95 |
"_ZN1C12_GLOBAL__N_11DINS_1EEEEN1F1GIDTadcldtcvT__E1HEEEERKS5_NS_1I1JE", |
| 96 |
"F::G<decltype (&((((C::E)()).H)()))> C::(anonymous namespace)::D<C::E>(C::E const&, C::I::J)", |
| 97 |
"C::(anonymous namespace)::D<C::E>", |
| 98 |
"F::G C::(anonymous namespace)::D(C::E const&, C::I::J)", |
| 99 |
"F::G<decltype (&((((C::E)()).H)()))> C::(anonymous namespace)::D<C::E>(C::E const&, C::I::J)", |
| 100 |
"C::(anonymous namespace)::D", |
| 101 |
}, |
| 102 |
{ |
| 103 |
"_ZN1CI1DE1EIJiRiRPKcRA1_S4_S8_bS6_S3_RjRPKN1F1GERPKN1H1IEEEEvDpOT_", |
| 104 |
"void C<D>::E<int, int&, char const*&, char const (&) [1], char const (&) [1], bool, char const*&, int&, unsigned int&, F::G const*&, H::I const*&>(int&&, int&, char const*&, char const (&) [1], char const (&) [1], bool&&, char const*&, int&, unsigned int&, F::G const*&, H::I const*&)", |
| 105 |
"C<D>::E<int, int&, char const*&, char const (&) [1], char const (&) [1], bool, char const*&, int&, unsigned int&, F::G const*&, H::I const*&>", |
| 106 |
"void C::E(int&&, int&, char const*&, char const (&) [1], char const (&) [1], bool&&, char const*&, int&, unsigned int&, F::G const*&, H::I const*&)", |
| 107 |
"void C<D>::E<int, int&, char const*&, char const (&) [1], char const (&) [1], bool, char const*&, int&, unsigned int&, F::G const*&, H::I const*&>(int&&, int&, char const*&, char const (&) [1], char const (&) [1], bool&&, char const*&, int&, unsigned int&, F::G const*&, H::I const*&)", |
| 108 |
"C::E", |
| 109 |
}, |
| 110 |
{ |
| 111 |
"_ZN1C12_GLOBAL__N_11DIFbPKNS_1EEEEEvPNS_1FERKT_", |
| 112 |
"void C::(anonymous namespace)::D<bool (C::E const*)>(C::F*, bool (&)(C::E const*) const)", |
| 113 |
"C::(anonymous namespace)::D<bool (C::E const*)>", |
| 114 |
"void C::(anonymous namespace)::D(C::F*, bool (&)(C::E const*) const)", |
| 115 |
"void C::(anonymous namespace)::D<bool (C::E const*)>(C::F*, bool (&)(C::E const*) const)", |
| 116 |
"C::(anonymous namespace)::D", |
| 117 |
}, |
| 118 |
{ |
| 119 |
"_ZN1C1D1EIJRFviSt1FIFvRKN1G1H1IEEERKSt6vectorINS_1JESaISB_EEERiS9_EvEENS0_1K1LIJDpNSt1MIT_E1NEEEEDpOSM_", |
| 120 |
"C::D::K::L<std::M<void (&)(int, std::F<void (G::H::I const&)>, std::vector<C::J, std::allocator<C::J> > const&)>::N, std::M<int&>::N, std::M<std::F<void (G::H::I const&)> >::N> C::D::E<void (&)(int, std::F<void (G::H::I const&)>, std::vector<C::J, std::allocator<C::J> > const&), int&, std::F<void (G::H::I const&)>, void>(void (&)(int, std::F<void (G::H::I const&)>, std::vector<C::J, std::allocator<C::J> > const&), int&, std::F<void (G::H::I const&)>&&)", |
| 121 |
"C::D::E<void (&)(int, std::F<void (G::H::I const&)>, std::vector<C::J, std::allocator<C::J> > const&), int&, std::F<void (G::H::I const&)>, void>", |
| 122 |
"C::D::K::L C::D::E(void (&)(int, std::F, std::vector const&), int&, std::F&&)", |
| 123 |
"C::D::K::L<std::M<void (&)(int, std::F<void (G::H::I const&)>, std::vector<C::J, std::allocator<C::J> > const&)>::N, std::M<int&>::N, std::M<std::F<void (G::H::I const&)> >::N> C::D::E<void (&)(int, std::F<void (G::H::I const&)>, std::vector<C::J, std::allocator<C::J> > const&), int&, std::F<void (G::H::I const&)>, void>(void (&)(int, std::F<void (G::H::I const&)>, std::vector<C::J, std::allocator<C::J> > const&), int&, std::F<void (G::H::I const&)>&&)", |
| 124 |
"C::D::E", |
| 125 |
}, |
| 126 |
{ |
| 127 |
"_ZN1C1D1E1FcvNS_1GIT_EEI1HEEv", |
| 128 |
"C::D::E::F::operator C::G<H><H>()", |
| 129 |
"C::D::E::F::operator C::G<H><H>", |
| 130 |
"C::D::E::F::operator C::G()", |
| 131 |
"C::D::E::F::operator C::G<H><H>()", |
| 132 |
"C::D::E::F::operator C::G", |
| 133 |
}, |
| 134 |
{ |
| 135 |
"_ZN9__gnu_cxx17__normal_iteratorIPK1EIN1F1G1HEESt6vectorIS5_SaIS5_EEEC2IPS5_EERKNS0_IT_NS_11__enable_ifIXsr3std10__are_sameISE_SD_EE7__valueESA_E1IEEE", |
| 136 |
"__gnu_cxx::__normal_iterator<E<F::G::H> const*, std::vector<E<F::G::H>, std::allocator<E<F::G::H> > > >::__normal_iterator<E<F::G::H>*>(__gnu_cxx::__normal_iterator<E<F::G::H>*, __gnu_cxx::__enable_if<std::__are_same<E<F::G::H>*, E<F::G::H>*>::__value, std::vector<E<F::G::H>, std::allocator<E<F::G::H> > > >::I> const&)", |
| 137 |
"__gnu_cxx::__normal_iterator<E<F::G::H> const*, std::vector<E<F::G::H>, std::allocator<E<F::G::H> > > >::__normal_iterator<E<F::G::H>*>", |
| 138 |
"__gnu_cxx::__normal_iterator::__normal_iterator(__gnu_cxx::__normal_iterator const&)", |
| 139 |
"__gnu_cxx::__normal_iterator<E<F::G::H> const*, std::vector<E<F::G::H>, std::allocator<E<F::G::H> > > >::__normal_iterator<E<F::G::H>*>(__gnu_cxx::__normal_iterator<E<F::G::H>*, __gnu_cxx::__enable_if<std::__are_same<E<F::G::H>*, E<F::G::H>*>::__value, std::vector<E<F::G::H>, std::allocator<E<F::G::H> > > >::I> const&)", |
| 140 |
"__gnu_cxx::__normal_iterator::__normal_iterator", |
| 141 |
}, |
| 142 |
{ |
| 143 |
"_ZNKSt1CIM1DKFjvEEclIJEvEEjPKS0_DpOT_", |
| 144 |
"unsigned int std::C<unsigned int (D::*)() const>::operator()<void>(D const*) const", |
| 145 |
"std::C<unsigned int (D::*)() const>::operator()<void>", |
| 146 |
"unsigned int std::C::operator()(D const*) const", |
| 147 |
"unsigned int std::C<unsigned int (D::*)() const>::operator()<void>(D const*) const", |
| 148 |
"std::C::operator()", |
| 149 |
}, |
| 150 |
{ |
| 151 |
"_ZNSt10_HashtableI12basic_stringIcSt11char_traitsIcESaIcEESt4pairIKS4_N1C1D1EEESaISA_ENSt8__detail10_Select1stESt8equal_toIS4_ESt4hashIS4_ENSC_18_Mod_range_hashingENSC_20_Default_ranged_hashENSC_20_Prime_rehash_policyENSC_17_Hashtable_traitsILb1ELb0ELb1EEEE9_M_assignIZNSN_C1ERKSN_EUlPKNSC_10_Hash_nodeISA_Lb1EEEE_EEvSQ_RKT_", |
| 152 |
"void std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_assign<std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_Hashtable(std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> > const&)::{lambda(std::__detail::_Hash_node<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, true> const*)#1}>(std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> > const&, std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_Hashtable(std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> > const&)::{lambda(std::__detail::_Hash_node<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, true> const*)#1} const&)", |
| 153 |
"std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_assign<std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_Hashtable(std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> > const&)::{lambda(std::__detail::_Hash_node<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, true> const*)#1}>", |
| 154 |
"void std::_Hashtable::_M_assign(std::_Hashtable const&, std::_Hashtable::_Hashtable(std::_Hashtable const&)::{lambda(std::__detail::_Hash_node const*)#1} const&)", |
| 155 |
"void std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_assign<std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_Hashtable()::{lambda(std::__detail::_Hash_node<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, true> const*)#1}>(std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> > const&, std::_Hashtable<basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, std::allocator<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E> >, std::__detail::_Select1st, std::equal_to<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_Hashtable()::{lambda(std::__detail::_Hash_node<std::pair<basic_string<char, std::char_traits<char>, std::allocator<char> > const, C::D::E>, true> const*)#1} const&)", |
| 156 |
"std::_Hashtable::_M_assign", |
| 157 |
}, |
| 158 |
{ |
| 159 |
"_ZSt3maxIVdERKT_S3_S3_", |
| 160 |
"double const volatile& std::max<double volatile>(double const volatile&, double const volatile&)", |
| 161 |
"std::max<double volatile>", |
| 162 |
"double const volatile& std::max(double const volatile&, double const volatile&)", |
| 163 |
"double const volatile& std::max<double volatile>(double const volatile&, double const volatile&)", |
| 164 |
"std::max", |
| 165 |
}, |
| 166 |
{ |
| 167 |
"_ZZN1C1D1E1F1G1HEvENUlvE_C2EOS4_", |
| 168 |
"C::D::E::F::G::H()::{lambda()#1}::{lambda()#1}({lambda()#1}&&)", |
| 169 |
"C::D::E::F::G::H()::{lambda()#1}::{lambda()#1}", |
| 170 |
"C::D::E::F::G::H()::{lambda()#1}::{lambda()#1}({lambda()#1}&&)", |
| 171 |
"C::D::E::F::G::H()::{lambda()#1}::{lambda()#1}({lambda()#1}&&)", |
| 172 |
"C::D::E::F::G::H()::{lambda()#1}::{lambda()#1}", |
| 173 |
}, |
| 174 |
{ |
| 175 |
"_ZThn8_NK1C1D1EEv", |
| 176 |
"non-virtual thunk to C::D::E() const", |
| 177 |
"non-virtual thunk to C::D::E() const", |
| 178 |
"non-virtual thunk to C::D::E() const", |
| 179 |
"non-virtual thunk to C::D::E() const", |
| 180 |
"non-virtual thunk to C::D::E() const", |
| 181 |
}, |
| 182 |
{ |
| 183 |
"_ZTv0_n96_NK1C1D1E1FEv", |
| 184 |
"virtual thunk to C::D::E::F() const", |
| 185 |
"virtual thunk to C::D::E::F() const", |
| 186 |
"virtual thunk to C::D::E::F() const", |
| 187 |
"virtual thunk to C::D::E::F() const", |
| 188 |
"virtual thunk to C::D::E::F() const", |
| 189 |
}, |
| 190 |
{ |
| 191 |
"_ZTCSt9strstream16_So", |
| 192 |
"construction vtable for std::ostream-in-std::strstream", |
| 193 |
"construction vtable for std::ostream-in-std::strstream", |
| 194 |
"construction vtable for std::ostream-in-std::strstream", |
| 195 |
"construction vtable for std::ostream-in-std::strstream", |
| 196 |
"construction vtable for std::ostream-in-std::strstream", |
| 197 |
}, |
| 198 |
{ |
| 199 |
"_ZGVZZN1C1D1EEvENK3$_0clEvE1F", |
| 200 |
"guard variable for C::D::E()::$_0::operator()() const::F", |
| 201 |
"guard variable for C::D::E()::$_0::operator()() const::F", |
| 202 |
"guard variable for C::D::E()::$_0::operator()() const::F", |
| 203 |
"guard variable for C::D::E()::$_0::operator()() const::F", |
| 204 |
"guard variable for C::D::E()::$_0::operator()() const::F", |
| 205 |
}, |
| 206 |
{ |
| 207 |
"_Z1fICiEvT_", |
| 208 |
"void f<int _Complex>(int _Complex)", |
| 209 |
"f<int _Complex>", |
| 210 |
"void f(int _Complex)", |
| 211 |
"void f<int _Complex>(int _Complex)", |
| 212 |
"f", |
| 213 |
}, |
| 214 |
{ |
| 215 |
"_GLOBAL__D__Z2fnv", |
| 216 |
"global destructors keyed to fn()", |
| 217 |
"global destructors keyed to fn()", |
| 218 |
"global destructors keyed to fn()", |
| 219 |
"global destructors keyed to fn()", |
| 220 |
"global destructors keyed to fn()", |
| 221 |
}, |
| 222 |
{ |
| 223 |
"_Z1fIXadL_Z1hvEEEvv", |
| 224 |
"void f<&h>()", |
| 225 |
"f<&h>", |
| 226 |
"void f()", |
| 227 |
"void f<&h>()", |
| 228 |
"f", |
| 229 |
}, |
| 230 |
{ |
| 231 |
"_Z1CIP1DEiRK1EPT_N1F1GIS5_Xaasr1HIS5_E1IntsrSA_1JEE1KE", |
| 232 |
"int C<D*>(E const&, D**, F::G<D*, H<D*>::I&&(!H::J)>::K)", |
| 233 |
"C<D*>", |
| 234 |
"int C(E const&, D**, F::G::K)", |
| 235 |
"int C<D*>(E const&, D**, F::G<D*, H<D*>::I&&(!H::J)>::K)", |
| 236 |
"C", |
| 237 |
}, |
| 238 |
{ |
| 239 |
"_ZNO1A1B1C1DIZN1E1F1GINS3_1HE1IEEvMNS3_1JEFvP1LPKT_PT0_P1KESD_SA_SF_SH_EUlvE_Lb0EEcvPSB_ISG_vvEEv", |
| 240 |
"A::B::C::D<E::F::G<E::H, I>(void (E::J::*)(L*, E::H const*, I*, K*), E::H const*, L*, I*, K*)::{lambda()#1}, false>::operator K*<K, void, void>() &&", |
| 241 |
"A::B::C::D<E::F::G<E::H, I>(void (E::J::*)(L*, E::H const*, I*, K*), E::H const*, L*, I*, K*)::{lambda()#1}, false>::operator K*<K, void, void>", |
| 242 |
"A::B::C::D::operator K*() &&", |
| 243 |
"A::B::C::D<E::F::G<E::H, I>()::{lambda()#1}, false>::operator K*<K, void, void>() &&", |
| 244 |
"A::B::C::D::operator K*", |
| 245 |
}, |
| 246 |
{ |
| 247 |
"_ZNSt1AIFSt1BImjEjEZN1C1DI1EEENSt1FIXeqsr1G1H1IIDTadsrT_onclEEE1JLi2EEvE1KEPKcSC_OS7_EUljE_E1KERKSt1Lj", |
| 248 |
"std::A<std::B<unsigned long, unsigned int> (unsigned int), C::D<E>(char const*, char const, I&&)::{lambda(unsigned int)#1}>::K(std::L const&, unsigned int)", |
| 249 |
"std::A<std::B<unsigned long, unsigned int> (unsigned int), C::D<E>(char const*, char const, I&&)::{lambda(unsigned int)#1}>::K", |
| 250 |
"std::A::K(std::L const&, unsigned int)", |
| 251 |
"std::A<std::B<unsigned long, unsigned int> (unsigned int), C::D<E>()::{lambda(unsigned int)#1}>::K(std::L const&, unsigned int)", |
| 252 |
"std::A::K", |
| 253 |
}, |
| 254 |
{ |
| 255 |
"_ZNSt1A1BIiNS_1CIiEEE1DIPiEENS_1EIXaasr1FIT_EE1Gsr1HIiNS_1IIS7_E1JEEE1KEvE1LES7_S7_", |
| 256 |
"std::A::E<F<int*>::G&&H<int, std::A::I<F>::J>::K, void>::L std::A::B<int, std::A::C<int> >::D<int*>(F, F)", |
| 257 |
"std::A::B<int, std::A::C<int> >::D<int*>", |
| 258 |
"std::A::E::L std::A::B::D(F, F)", |
| 259 |
"std::A::E<F<int*>::G&&H<int, std::A::I<F>::J>::K, void>::L std::A::B<int, std::A::C<int> >::D<int*>(F, F)", |
| 260 |
"std::A::B::D", |
| 261 |
}, |
| 262 |
{ |
| 263 |
"_ZNO1A1B1C1DIJOZZN1E1F1GINS4_1HINS4_1IINS4_1JEEEEEJNS4_1KEEEEN1L1MINS4_1OINT_1PEEEEERKSt6vectorIN1Q1RESaISL_EERKN3gtl1S1TIN1U1VEEERKNS4_1W1XERKNS4_1YERKNSQ_1ZINS4_1aEEEPSt13unordered_mapISL_NSK_9UniquePtrINS4_1bINS0_1cIJS9_NS7_INST_1dEEEEEENS4_1fEEEEENSC_1g1hIvEESt8equal_toISL_ESaISt4pairIKSL_S1J_EEEDpRKT0_ENKUlSL_mmS1G_E_clESL_mmS1G_EUlS9_E_OZZNS5_ISA_JSB_EEESI_SP_SX_S11_S14_S19_S1U_S1Y_ENKS1Z_clESL_mmS1G_EUlS1F_E0_EEclIJRS9_EEEDTclcl1iIXsrNS1_1jISt5tupleIJNS1_1kIS21_EENS29_IS23_EEEEJDpT_EEE1lEEcl1mIS2C_EEEspcl1mIS2D_EEEEDpOS2D_", |
| 264 |
"decltype (((i<A::B::C::j<std::tuple<A::B::C::k<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>(std::vector<Q::R, std::allocator<Q::R> > const&, gtl::S::T<U::V> const&, E::F::W::X const&, E::F::Y const&, gtl::Z<E::F::a> const&, std::unordered_map<Q::R, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> >, L::g::h<void>, std::equal_to<Q::R>, std::allocator<std::pair<Q::R const, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> > > > >*, E::F::K const&)::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >) const::{lambda(E::F::I<E::F::J>)#1}&&>, A::B::C::k<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>(std::vector<Q::R, std::allocator<Q::R> > const&, gtl::S::T<U::V> const&, E::F::W::X const&, E::F::Y const&, gtl::Z<E::F::a> const&, std::unordered_map<Q::R, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> >, L::g::h<void>, std::equal_to<Q::R>, std::allocator<std::pair<Q::R const, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> > > > >*, E::F::K const&)::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >) const::{lambda(E::F::I<U::d>)#2}&&> >, E::F::I<E::F::J>&>::l>)((m<std::tuple<A::B::C::k<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>(std::vector<Q::R, std::allocator<Q::R> > const&, gtl::S::T<U::V> const&, E::F::W::X const&, E::F::Y const&, gtl::Z<E::F::a> const&, std::unordered_map<Q::R, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> >, L::g::h<void>, std::equal_to<Q::R>, std::allocator<std::pair<Q::R const, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> > > > >*, E::F::K const&)::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >) const::{lambda(E::F::I<E::F::J>)#1}&&>, A::B::C::k<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>(std::vector<Q::R, std::allocator<Q::R> > const&, gtl::S::T<U::V> const&, E::F::W::X const&, E::F::Y const&, gtl::Z<E::F::a> const&, std::unordered_map<Q::R, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> >, L::g::h<void>, std::equal_to<Q::R>, std::allocator<std::pair<Q::R const, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> > > > >*, E::F::K const&)::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >) const::{lambda(E::F::I<U::d>)#2}&&> > >)()))((m<E::F::I<E::F::J>&>)())) A::B::C::D<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>(std::vector<Q::R, std::allocator<Q::R> > const&, gtl::S::T<U::V> const&, E::F::W::X const&, E::F::Y const&, gtl::Z<E::F::a> const&, std::unordered_map<Q::R, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> >, L::g::h<void>, std::equal_to<Q::R>, std::allocator<std::pair<Q::R const, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> > > > >*, E::F::K const&)::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >) const::{lambda(E::F::I<E::F::J>)#1}&&, E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>(std::vector<Q::R, std::allocator<Q::R> > const&, gtl::S::T<U::V> const&, E::F::W::X const&, E::F::Y const&, gtl::Z<E::F::a> const&, std::unordered_map<Q::R, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> >, L::g::h<void>, std::equal_to<Q::R>, std::allocator<std::pair<Q::R const, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> > > > >*, E::F::K const&)::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >) const::{lambda(E::F::I<U::d>)#2}&&>::operator()<E::F::I<E::F::J>&>(E::F::I<E::F::J>&) &&", |
| 265 |
"A::B::C::D<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>(std::vector<Q::R, std::allocator<Q::R> > const&, gtl::S::T<U::V> const&, E::F::W::X const&, E::F::Y const&, gtl::Z<E::F::a> const&, std::unordered_map<Q::R, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> >, L::g::h<void>, std::equal_to<Q::R>, std::allocator<std::pair<Q::R const, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> > > > >*, E::F::K const&)::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >) const::{lambda(E::F::I<E::F::J>)#1}&&, E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>(std::vector<Q::R, std::allocator<Q::R> > const&, gtl::S::T<U::V> const&, E::F::W::X const&, E::F::Y const&, gtl::Z<E::F::a> const&, std::unordered_map<Q::R, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> >, L::g::h<void>, std::equal_to<Q::R>, std::allocator<std::pair<Q::R const, Q::UniquePtr<E::F::b<A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >, E::F::f> > > > >*, E::F::K const&)::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >) const::{lambda(E::F::I<U::d>)#2}&&>::operator()<E::F::I<E::F::J>&>", |
| 266 |
"decltype (((i)((m)()))((m)())) A::B::C::D::operator()(E::F::I&) &&", |
| 267 |
"decltype (((i<A::B::C::j<std::tuple<A::B::C::k<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>()::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()() const::{lambda(E::F::I<E::F::J>)#1}&&>, A::B::C::k<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>()::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()() const::{lambda(E::F::I<U::d>)#2}&&> >, E::F::I<E::F::J>&>::l>)((m<std::tuple<A::B::C::k<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>()::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()() const::{lambda(E::F::I<E::F::J>)#1}&&>, A::B::C::k<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>()::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()() const::{lambda(E::F::I<U::d>)#2}&&> > >)()))((m<E::F::I<E::F::J>&>)())) A::B::C::D<E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>()::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()() const::{lambda(E::F::I<E::F::J>)#1}&&, E::F::G<E::F::H<E::F::I<E::F::J> >, E::F::K>()::{lambda(Q::R, unsigned long, unsigned long, A::B::c<E::F::I<E::F::J>, E::F::I<U::d> >)#1}::operator()() const::{lambda(E::F::I<U::d>)#2}&&>::operator()<E::F::I<E::F::J>&>(E::F::I<E::F::J>&) &&", |
| 268 |
"A::B::C::D::operator()", |
| 269 |
}, |
| 270 |
{ |
| 271 |
"_ZcvAna_eE_e", |
| 272 |
"operator long double [new long double]", |
| 273 |
"operator long double [new long double]", |
| 274 |
"operator long double [new long double]", |
| 275 |
"operator long double [new long double]", |
| 276 |
"operator long double [new long double]", |
| 277 |
}, |
| 278 |
{ |
| 279 |
"_ZZ1irFeeEES_S_", |
| 280 |
"i(() restrict)::long double (long double)(() restrict) restrict", |
| 281 |
"i(long double (long double) restrict)::long double (long double)", |
| 282 |
"i(() restrict)::long double (long double)(() restrict) restrict", |
| 283 |
"i()::long double (long double)(() restrict) restrict", |
| 284 |
"i()::long double (long double)", |
| 285 |
}, |
| 286 |
{ |
| 287 |
"_Z1_VFaeEZS_S_ES_", |
| 288 |
"_((() volatile) volatile, signed char (long double)(() volatile) volatile::(() volatile) volatile)", |
| 289 |
"_", |
| 290 |
"_((() volatile) volatile, signed char (long double)(() volatile) volatile::(() volatile) volatile)", |
| 291 |
"_(() volatile, signed char (long double)() volatile::() volatile)", |
| 292 |
"_", |
| 293 |
}, |
| 294 |
{ |
| 295 |
"_ZdsrFliEZS_GS_EcvS_", |
| 296 |
"operator.*(( ( _Imaginary)( _Imaginary) restrict) restrict, long (int)( ( _Imaginary)( _Imaginary) restrict) restrict::operator ( ( _Imaginary)( _Imaginary) restrict) restrict)", |
| 297 |
"operator.*", |
| 298 |
"operator.*(( ( _Imaginary)( _Imaginary) restrict) restrict, long (int)( ( _Imaginary)( _Imaginary) restrict) restrict::operator ( ( _Imaginary)( _Imaginary) restrict) restrict)", |
| 299 |
"operator.*(() restrict, long (int)() restrict::operator () restrict)", |
| 300 |
"operator.*", |
| 301 |
}, |
| 302 |
{ |
| 303 |
"_ZZN1A1B1CIfEEvPNS_1DERKNS_1EEiS6_T_S7_S7_RKNSt3__u1FIFS7_iiEEEbbPiENKUlZNS1_IfEEvS3_S6_iS6_S7_S7_S7_SD_bbSE_E1GSF_E_clESF_SF_", |
| 304 |
"A::B::C<float>(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F<float (int, int)> const&, bool, bool, int*)::{lambda(A::B::C<float>(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F<float (int, int)> const&, bool, bool, int*)::G, A::B::C<float>(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F<float (int, int)> const&, bool, bool, int*)::G)#1}::operator()(A::B::C<float>(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F<float (int, int)> const&, bool, bool, int*)::G, A::B::C<float>(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F<float (int, int)> const&, bool, bool, int*)::G) const", |
| 305 |
"A::B::C<float>(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F<float (int, int)> const&, bool, bool, int*)::{lambda(A::B::C<float>(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F<float (int, int)> const&, bool, bool, int*)::G, A::B::C<float>(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F<float (int, int)> const&, bool, bool, int*)::G)#1}::operator()", |
| 306 |
"A::B::C(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F const&, bool, bool, int*)::{lambda(A::B::C(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F const&, bool, bool, int*)::G, A::B::C(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F const&, bool, bool, int*)::G)#1}::operator()(A::B::C(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F const&, bool, bool, int*)::G, A::B::C(A::D*, A::E const&, int, A::E const&, float, float, float, std::__u::F const&, bool, bool, int*)::G) const", |
| 307 |
"A::B::C<float>()::{lambda(A::B::C<float>()::G, A::B::C<float>()::G)#1}::operator()(A::B::C<float>()::G, A::B::C<float>()::G) const", |
| 308 |
"A::B::C()::{lambda(A::B::C()::G, A::B::C()::G)#1}::operator()", |
| 309 |
}, |
| 310 |
{ |
| 311 |
"_ZN1A1B1CIJLNS_1DE131067ELS2_4EEEC2EUa9enable_ifIXclL_ZNS0_1EIJLS2_131067ELS2_4EEEEbNSt1F1GIcNS5_1HIcEEEEEfL0p_EEEPKc", |
| 312 |
"A::B::C<(A::D)131067, (A::D)4>::C(char const*) [enable_if:bool A::B::E<(A::D)131067, (A::D)4>(std::F::G<char, std::F::H<char> >)({parm#1})]", |
| 313 |
"A::B::C<(A::D)131067, (A::D)4>::C", |
| 314 |
"A::B::C::C(char const*) [enable_if:bool A::B::E(std::F::G)({parm#1})]", |
| 315 |
"A::B::C<(A::D)131067, (A::D)4>::C(char const*) [enable_if:bool A::B::E<(A::D)131067, (A::D)4>(std::F::G<char, std::F::H<char> >)({parm#1})]", |
| 316 |
"A::B::C::C", |
| 317 |
}, |
| 318 |
{ |
| 319 |
"_ZNK1A1B1C1DINS0_1EIKZNK1F1G1HIJNS4_1IINSt1J1KIcNS8_1LIcEENS8_1MIcEEEEEENS4_1NIixEEEE1OEvEUlRT_E_EERKNS8_1PIJNS4_1QISF_EENSP_ISH_EEEEEEclILm0EEEDTcldtclL_ZNS8_1RIRKSN_EEDTclsr3std1SE1TISJ_ELi0EEEvEEonclIXT_EEcl1UIXT_EEclL_ZNSX_ISU_EES10_vEEEEEv", |
| 320 |
"decltype (((decltype (std::S::T<A::B::E<F::G::H<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > >, F::N<int, long long> >::O() const::{lambda(auto:1&)#1} const> const&>(0)) std::J::R<A::B::E<F::G::H<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > >, F::N<int, long long> >::O() const::{lambda(auto:1&)#1} const> const&>()()).(operator()<0ul>))((U<0ul>)(decltype (std::S::T<std::J::P<F::Q<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > > >, F::Q<F::N<int, long long> > > const&>(0)) std::J::R<std::J::P<F::Q<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > > >, F::Q<F::N<int, long long> > > const&>()()))) A::B::C::D<A::B::E<F::G::H<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > >, F::N<int, long long> >::O() const::{lambda(auto:1&)#1} const>, std::J::P<F::Q<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > > >, F::Q<F::N<int, long long> > > const&>::operator()<0ul>() const", |
| 321 |
"A::B::C::D<A::B::E<F::G::H<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > >, F::N<int, long long> >::O() const::{lambda(auto:1&)#1} const>, std::J::P<F::Q<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > > >, F::Q<F::N<int, long long> > > const&>::operator()<0ul>", |
| 322 |
"decltype (((decltype (std::S::T(0)) std::J::R()()).(operator()))((U)(decltype (std::S::T(0)) std::J::R()()))) A::B::C::D::operator()() const", |
| 323 |
"decltype (((decltype (std::S::T<A::B::E<F::G::H<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > >, F::N<int, long long> >::O() const::{lambda(auto:1&)#1} const> const&>(0)) std::J::R<A::B::E<F::G::H<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > >, F::N<int, long long> >::O() const::{lambda(auto:1&)#1} const> const&>()()).(operator()<0ul>))((U<0ul>)(decltype (std::S::T<std::J::P<F::Q<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > > >, F::Q<F::N<int, long long> > > const&>(0)) std::J::R<std::J::P<F::Q<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > > >, F::Q<F::N<int, long long> > > const&>()()))) A::B::C::D<A::B::E<F::G::H<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > >, F::N<int, long long> >::O() const::{lambda(auto:1&)#1} const>, std::J::P<F::Q<F::I<std::J::K<char, std::J::L<char>, std::J::M<char> > > >, F::Q<F::N<int, long long> > > const&>::operator()<0ul>() const", |
| 324 |
"A::B::C::D::operator()", |
| 325 |
}, |
| 326 |
{ |
| 327 |
"_ZN1A1B1CIKZN1D1E1FIJNS2_1GINSt1H1IIcNS6_1JIcEENS6_1KIcEEEEiEENS5_IixEEEE1LEvEUlRT_E_EC2EPSJ_", |
| 328 |
"A::B::C<D::E::F<D::G<std::H::I<char, std::H::J<char>, std::H::K<char> >, int>, D::G<int, long long> >::L()::{lambda(auto:1&)#1} const>::C(D::E::F<D::G<std::H::I<char, std::H::J<char>, std::H::K<char> >, int>, D::G<int, long long> >::L()::{lambda(auto:1&)#1} const*)", |
| 329 |
"A::B::C<D::E::F<D::G<std::H::I<char, std::H::J<char>, std::H::K<char> >, int>, D::G<int, long long> >::L()::{lambda(auto:1&)#1} const>::C", |
| 330 |
"A::B::C::C(D::E::F::L()::{lambda(auto:1&)#1} const*)", |
| 331 |
"A::B::C<D::E::F<D::G<std::H::I<char, std::H::J<char>, std::H::K<char> >, int>, D::G<int, long long> >::L()::{lambda(auto:1&)#1} const>::C(D::E::F<D::G<std::H::I<char, std::H::J<char>, std::H::K<char> >, int>, D::G<int, long long> >::L()::{lambda(auto:1&)#1} const*)", |
| 332 |
"A::B::C::C", |
| 333 |
}, |
| 334 |
{ |
| 335 |
"_ZN1A1B1CILb0EvOZN1D1E1FINS3_1GENS3_1HENS3_1IEE1JEvEUlvE0_JEEET0_PNS0_1KEDpDTcp1KIT2_EcvNSt1L1MIbXsr1NE1OISE_EEEE_EEE", |
| 336 |
"void A::B::C<false, void, D::E::F<D::E::G, D::E::H, D::E::I>::J()::{lambda()#2}&&>(A::B::K*)", |
| 337 |
"A::B::C<false, void, D::E::F<D::E::G, D::E::H, D::E::I>::J()::{lambda()#2}&&>", |
| 338 |
"void A::B::C(A::B::K*)", |
| 339 |
"void A::B::C<false, void, D::E::F<D::E::G, D::E::H, D::E::I>::J()::{lambda()#2}&&>(A::B::K*)", |
| 340 |
"A::B::C", |
| 341 |
}, |
| 342 |
{ |
| 343 |
"_ZN1A1BIJNS_1C1DIJNS_1EENS_1FEEEEENSt1G1HIcNS6_1IIcEENS6_1JIcEEEEEEDTcl1KINS1_1KIsr1LIT0_EE1NJNS1_1MIJDpT_EE1NEEE1N1NEEcldtfp_1OEfp0_EERKNS_1PISE_EEPKc", |
| 344 |
"decltype ((K<A::C::K<short, L<std::G::H<char, std::G::I<char>, std::G::J<char> > > restrict>::N<A::C::M<A::C::D<A::E, A::F> >::N>::N::N>)(({parm#1}.O)(), {parm#2})) A::B<A::C::D<A::E, A::F>, std::G::H<char, std::G::I<char>, std::G::J<char> > >(A::P<L> const&, char const*)", |
| 345 |
"A::B<A::C::D<A::E, A::F>, std::G::H<char, std::G::I<char>, std::G::J<char> > >", |
| 346 |
"decltype ((K)(({parm#1}.O)(), {parm#2})) A::B(A::P const&, char const*)", |
| 347 |
"decltype ((K<A::C::K<short, L<std::G::H<char, std::G::I<char>, std::G::J<char> > > restrict>::N<A::C::M<A::C::D<A::E, A::F> >::N>::N::N>)(({parm#1}.O)(), {parm#2})) A::B<A::C::D<A::E, A::F>, std::G::H<char, std::G::I<char>, std::G::J<char> > >(A::P<L> const&, char const*)", |
| 348 |
"A::B", |
| 349 |
}, |
| 350 |
{ |
| 351 |
"_ZNSt1A1B1CIZN1D1E1F1GIZNS3_1H1IEixxE1JEENS_1KIFDTclclsr3stdE7declvalIT_EEEEvEEEPN1L1MENS_1OIcNS_1PIcEEEES9_EUlvE_FN1Q1RINS_1SIJNSD_1T1U1VENS6_1WEEEEEEvEEclEv", |
| 352 |
"std::A::B::C<D::E::F::G<D::E::H::I(int, long long, long long)::J>(L::M*, std::A::O<char, std::A::P<char> >, D::E::H::I(int, long long, long long)::J)::{lambda()#1}, Q::R<std::A::S<L::T::U::V, D::E::H::W> > ()>::operator()()", |
| 353 |
"std::A::B::C<D::E::F::G<D::E::H::I(int, long long, long long)::J>(L::M*, std::A::O<char, std::A::P<char> >, D::E::H::I(int, long long, long long)::J)::{lambda()#1}, Q::R<std::A::S<L::T::U::V, D::E::H::W> > ()>::operator()", |
| 354 |
"std::A::B::C::operator()()", |
| 355 |
"std::A::B::C<D::E::F::G<D::E::H::I()::J>()::{lambda()#1}, Q::R<std::A::S<L::T::U::V, D::E::H::W> > ()>::operator()()", |
| 356 |
"std::A::B::C::operator()", |
| 357 |
}, |
| 358 |
{ |
| 359 |
"_ZNSt1A1B1CIFN1D1EIN1F1G1HEEERKNS5_1IEEE1JINS0_1KIZN1L1MINS2_1NIS8_S6_EENS5_12_GLOBAL__N_11OES8_S6_EEN1P1QINS_1RINSH_IT1_T2_EENS_1SISQ_EEEEEENS_1TIKT_EENSF_1UET0_EUlSA_E_SB_EEEES7_PKNS0_1VESA_", |
| 360 |
"D::E<F::G::H> std::A::B::C<D::E<F::G::H> (F::G::I const&)>::J<std::A::B::K<L::M<D::N<F::G::I, F::G::H>, F::G::(anonymous namespace)::O, F::G::I, F::G::H>(std::A::T<D::N<F::G::I, F::G::H> const>, L::U, F::G::(anonymous namespace)::O)::{lambda(F::G::I const&)#1}, D::E<F::G::H> (F::G::I const&)> >(std::A::B::V const*, F::G::I const&)", |
| 361 |
"std::A::B::C<D::E<F::G::H> (F::G::I const&)>::J<std::A::B::K<L::M<D::N<F::G::I, F::G::H>, F::G::(anonymous namespace)::O, F::G::I, F::G::H>(std::A::T<D::N<F::G::I, F::G::H> const>, L::U, F::G::(anonymous namespace)::O)::{lambda(F::G::I const&)#1}, D::E<F::G::H> (F::G::I const&)> >", |
| 362 |
"D::E std::A::B::C::J(std::A::B::V const*, F::G::I const&)", |
| 363 |
"D::E<F::G::H> std::A::B::C<D::E<F::G::H> (F::G::I const&)>::J<std::A::B::K<L::M<D::N<F::G::I, F::G::H>, F::G::(anonymous namespace)::O, F::G::I, F::G::H>()::{lambda(F::G::I const&)#1}, D::E<F::G::H> (F::G::I const&)> >(std::A::B::V const*, F::G::I const&)", |
| 364 |
"std::A::B::C::J", |
| 365 |
}, |
| 366 |
{ |
| 367 |
"_ZGVZNK1A1B1CIZNKS0_1DIXadL_ZNS_1EIvE1FEvEES4_EcvNS_1GIFT_DpT0_EEEIvJEvEEvEUlPS4_E_S4_EcvSB_IvJEEEvE1H", |
| 368 |
"guard variable for A::B::C<A::B::D<&A::E<void>::F, A::E<void> >::operator A::G<void (()...)><void, void>() const::{lambda(A::E<void>*)#1}, A::E<void> >::operator A::G<void (()...)><void>() const::H", |
| 369 |
"guard variable for A::B::C<A::B::D<&A::E<void>::F, A::E<void> >::operator A::G<void (()...)><void, void>() const::{lambda(A::E<void>*)#1}, A::E<void> >::operator A::G<void (()...)><void>() const::H", |
| 370 |
"guard variable for A::B::C::operator A::G() const::H", |
| 371 |
"guard variable for A::B::C<A::B::D<&A::E<void>::F, A::E<void> >::operator A::G<void (()...)><void, void>() const::{lambda(A::E<void>*)#1}, A::E<void> >::operator A::G<void (()...)><void>() const::H", |
| 372 |
"guard variable for A::B::C::operator A::G() const::H", |
| 373 |
}, |
| 374 |
{ |
| 375 |
"_ZNKSt2Cr1AIN1B1CENS_1DIS2_EEEcvbB7v170000Ev", |
| 376 |
"std::Cr::A<B::C, std::Cr::D<B::C> >::operator bool[abi:v170000]() const", |
| 377 |
"std::Cr::A<B::C, std::Cr::D<B::C> >::operator bool[abi:v170000]", |
| 378 |
"std::Cr::A::operator bool[abi:v170000]() const", |
| 379 |
"std::Cr::A<B::C, std::Cr::D<B::C> >::operator bool[abi:v170000]() const", |
| 380 |
"std::Cr::A::operator bool[abi:v170000]", |
| 381 |
}, |
| 382 |
{ |
| 383 |
"_ZN1A1B1CIZN1D1E1FINS2_2KVINSt3__u1GIcNS6_1HIcEENS6_1IIcEEEESC_EEEENS_1JERKN1K1L1M1NENS_1OIFvvEEENSL_IFvRKT_EEEPNS6_1PIXsr1Q1R1SISO_EE1TENSH_1TISO_EENSH_1UISO_EEE1VEEUlRKNSH_1WES13_E_vJS13_S13_EEET0_NS0_1XEDpNS0_1YIT1_E1ZE", |
| 384 |
"void A::B::C<D::E::F<D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > >(K::L::M::N const&, A::O<void ()>, A::O<void (D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > const&)>, std::__u::P<Q::R::S<D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > >::T, K::L::M::T<D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > >, K::L::M::U<D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > > >::V*)::{lambda(K::L::M::W const&, K::L::M::W const)#1}, void, K::L::M::W const, K::L::M::W const>(A::B::X, A::B::Y<K::L::M::W const>::Z, A::B::Y<K::L::M::W const>::Z)", |
| 385 |
"A::B::C<D::E::F<D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > >(K::L::M::N const&, A::O<void ()>, A::O<void (D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > const&)>, std::__u::P<Q::R::S<D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > >::T, K::L::M::T<D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > >, K::L::M::U<D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > > >::V*)::{lambda(K::L::M::W const&, K::L::M::W const)#1}, void, K::L::M::W const, K::L::M::W const>", |
| 386 |
"void A::B::C(A::B::X, A::B::Y::Z, A::B::Y::Z)", |
| 387 |
"void A::B::C<D::E::F<D::KV<std::__u::G<char, std::__u::H<char>, std::__u::I<char> >, std::__u::G<char, std::__u::H<char>, std::__u::I<char> > > >()::{lambda(K::L::M::W const&, K::L::M::W const)#1}, void, K::L::M::W const, K::L::M::W const>(A::B::X, A::B::Y<K::L::M::W const>::Z, A::B::Y<K::L::M::W const>::Z)", |
| 388 |
"A::B::C", |
| 389 |
}, |
| 390 |
{ |
| 391 |
"_ZZNK1P1A1B1CIZNS0_1DIJETpTnRiJENS0_1E1F1GEvEENS_1HIFvDpT_EEEN1J1KINS0_1LIT1_EEEEEUlPNSF_IS7_EEE_SJ_EcvNS8_IFT_DpT0_EEEIvJEQsr1ME1NITL0__SN_PT0_DpTL0_0_EEEvENKUllE_clEl", |
| 392 |
"P::A::B::C<P::A::D<, P::A::E::F::G, void>(J::K<P::A::L<P::A::E::F::G> >)::{lambda(P::A::L<P::A::E::F::G>*)#1}, P::A::L<P::A::E::F::G> >::operator P::H<void (()...)><void>() const requires M::N<TL0_, T0, T0*, TL0_0...>::{lambda(long)#1}::operator()(long) const", |
| 393 |
"P::A::B::C<P::A::D<, P::A::E::F::G, void>(J::K<P::A::L<P::A::E::F::G> >)::{lambda(P::A::L<P::A::E::F::G>*)#1}, P::A::L<P::A::E::F::G> >::operator P::H<void (()...)><void>() const requires M::N<TL0_, T0, T0*, TL0_0...>::{lambda(long)#1}::operator()", |
| 394 |
"P::A::B::C::operator P::H() const requires M::N::{lambda(long)#1}::operator()(long) const", |
| 395 |
"P::A::B::C<P::A::D<, P::A::E::F::G, void>()::{lambda(P::A::L<P::A::E::F::G>*)#1}, P::A::L<P::A::E::F::G> >::operator P::H<void (()...)><void>() const requires M::N<TL0_, T0, T0*, TL0_0...>::{lambda(long)#1}::operator()(long) const", |
| 396 |
"P::A::B::C::operator P::H() const requires M::N::{lambda(long)#1}::operator()", |
| 397 |
}, |
| 398 |
{ |
| 399 |
"_ZN1AEDwF1BaEEa", |
| 400 |
"A(signed char throw(B ( throw(B (signed char)))(signed char)))", |
| 401 |
"A", |
| 402 |
"A(signed char throw(B ( throw(B (signed char)))(signed char)))", |
| 403 |
"A(signed char throw(B ( throw(B (signed char)))(signed char)))", |
| 404 |
"A", |
| 405 |
}, |
| 406 |
} |
| 407 |
|
| 408 |
// Check test cases discovered after the code passed the tests in |
| 409 |
// demangle-expected (which are tested by TestExpected). Some of this |
| 410 |
// are cases where we differ from the standard demangler, some we are |
| 411 |
// the same but we weren't initially. |
| 412 |
func TestDemangler(t *testing.T) { |
| 413 |
for _, test := range demanglerTests { |
| 414 |
if got, err := ToString(test.input); err != nil { |
| 415 |
t.Errorf("demangling %s: unexpected error %v", test.input, err) |
| 416 |
} else if got != test.want { |
| 417 |
t.Errorf("demangling %s: got %s, want %s", test.input, got, test.want) |
| 418 |
} |
| 419 |
|
| 420 |
if got, err := ToString(test.input, NoParams); err != nil { |
| 421 |
t.Errorf("demangling NoParams %s: unexpected error %v", test.input, err) |
| 422 |
} else if got != test.wantNoParams { |
| 423 |
t.Errorf("demangling NoParams %s: got %s, want %s", test.input, got, test.wantNoParams) |
| 424 |
} |
| 425 |
|
| 426 |
if got, err := ToString(test.input, NoTemplateParams); err != nil { |
| 427 |
t.Errorf("demangling NoTemplateParams %s: unexpected error %v", test.input, err) |
| 428 |
} else if got != test.wantNoTemplateParams { |
| 429 |
t.Errorf("demangling NoTemplateParams %s: got %s, want %s", test.input, got, test.wantNoTemplateParams) |
| 430 |
} |
| 431 |
|
| 432 |
if got, err := ToString(test.input, NoEnclosingParams); err != nil { |
| 433 |
t.Errorf("demangling NoEnclosingParams %s: unexpected error %v", test.input, err) |
| 434 |
} else if got != test.wantNoEnclosingParams { |
| 435 |
t.Errorf("demangling NoEnclosingParams %s: got %s, want %s", test.input, got, test.wantNoEnclosingParams) |
| 436 |
} |
| 437 |
|
| 438 |
if got, err := ToString(test.input, NoParams, NoTemplateParams, NoEnclosingParams); err != nil { |
| 439 |
t.Errorf("demangling NoTemplateParams %s: unexpected error %v", test.input, err) |
| 440 |
} else if got != test.wantMinimal { |
| 441 |
t.Errorf("demangling Minimal %s: got %s, want %s", test.input, got, test.wantMinimal) |
| 442 |
} |
| 443 |
|
| 444 |
// Test Filter also. |
| 445 |
if got := Filter(test.input); got != test.want { |
| 446 |
t.Errorf("Filter(%s) == %s, want %s", test.input, got, test.want) |
| 447 |
} |
| 448 |
} |
| 449 |
} |
| 450 |
|
| 451 |
// failureTests is tests for TestFailure. |
| 452 |
var failureTests = []struct { |
| 453 |
input string |
| 454 |
error string |
| 455 |
off int |
| 456 |
}{ |
| 457 |
{ |
| 458 |
"_Z1FE", |
| 459 |
"unparsed characters at end of mangled name", |
| 460 |
4, |
| 461 |
}, |
| 462 |
{ |
| 463 |
"_Z1FQ", |
| 464 |
"expected at least one type", |
| 465 |
4, |
| 466 |
}, |
| 467 |
{ |
| 468 |
"_ZZSaIL0D", |
| 469 |
"expected positive number", |
| 470 |
8, |
| 471 |
}, |
| 472 |
{ |
| 473 |
"_ZNKE", |
| 474 |
"expected prefix", |
| 475 |
4, |
| 476 |
}, |
| 477 |
{ |
| 478 |
"_ZcvT_", |
| 479 |
"not in scope of template", |
| 480 |
6, |
| 481 |
}, |
| 482 |
{ |
| 483 |
"_Z1AIXsZ1_EE", |
| 484 |
"missing argument pack", |
| 485 |
8, |
| 486 |
}, |
| 487 |
{ |
| 488 |
"_Z1gIEDTclspilE", |
| 489 |
"expected expression", |
| 490 |
15, |
| 491 |
}, |
| 492 |
{ |
| 493 |
"_ZNcvZN1ET_IEE", |
| 494 |
"after local name", |
| 495 |
14, |
| 496 |
}, |
| 497 |
{ |
| 498 |
"_Zv00", |
| 499 |
"expected positive number", |
| 500 |
5, |
| 501 |
}, |
| 502 |
{ |
| 503 |
"_ZcvT_B2T0", |
| 504 |
"template parameter not in scope", |
| 505 |
10, |
| 506 |
}, |
| 507 |
{ |
| 508 |
"_ZStcvT_", |
| 509 |
"template parameter not in scope", |
| 510 |
8, |
| 511 |
}, |
| 512 |
{ |
| 513 |
"_Z1aIeEU1RT_ZcvS1_", |
| 514 |
"expected E after local name", |
| 515 |
18, |
| 516 |
}, |
| 517 |
{ |
| 518 |
"_ZNcvT_oRIEE", |
| 519 |
"template index out of range", |
| 520 |
11, |
| 521 |
}, |
| 522 |
{ |
| 523 |
"_ZNcvT_D0IIEE", |
| 524 |
"expected prefix", |
| 525 |
13, |
| 526 |
}, |
| 527 |
{ |
| 528 |
"_ZcvT_IAoncvT__eE", |
| 529 |
"template parameter not in scope", |
| 530 |
14, |
| 531 |
}, |
| 532 |
{ |
| 533 |
"_ZZF", |
| 534 |
"expected unqualified name", |
| 535 |
4, |
| 536 |
}, |
| 537 |
{ |
| 538 |
"_ZNW1a", |
| 539 |
"expected unqualified name", |
| 540 |
6, |
| 541 |
}, |
| 542 |
{ |
| 543 |
"_ZNFcv1A", |
| 544 |
"expected prefix", |
| 545 |
8, |
| 546 |
}, |
| 547 |
{ |
| 548 |
"_ZZW1A1A1AZcvCS_1A000", |
| 549 |
"expected positive number", |
| 550 |
21, |
| 551 |
}, |
| 552 |
{ |
| 553 |
"_ZN5clang18IdentifierResolver10RemoveDeclEPNS_9NamedDDDDDDDeclE", |
| 554 |
"unknown destructor type", |
| 555 |
56, |
| 556 |
}, |
| 557 |
{ |
| 558 |
"_ZN4A000EArQ", |
| 559 |
"expected requirement parameter", |
| 560 |
12, |
| 561 |
}, |
| 562 |
{ |
| 563 |
"_ZNcvT_cv1AI1AEE", |
| 564 |
"cast in scope of cast", |
| 565 |
15, |
| 566 |
}, |
| 567 |
{ |
| 568 |
"_ZNcvaB7A000000B1A", |
| 569 |
"expected prefix", |
| 570 |
18, |
| 571 |
}, |
| 572 |
{ |
| 573 |
"_Z1AAoncvT__a", |
| 574 |
"template parameter not in scope", |
| 575 |
11, |
| 576 |
}, |
| 577 |
{ |
| 578 |
"_ZNcv1Acv1AIT_EE", |
| 579 |
"cast in scope of cast", |
| 580 |
15, |
| 581 |
}, |
| 582 |
{ |
| 583 |
"_ZN0_17h0000000000002718E", |
| 584 |
"expected positive number", |
| 585 |
4, |
| 586 |
}, |
| 587 |
{ |
| 588 |
"_Z1AI1AE1A1AIXplccCT_La0EdicvS4_La0EEE", |
| 589 |
"template parameter not in scope", |
| 590 |
32, |
| 591 |
}, |
| 592 |
} |
| 593 |
|
| 594 |
// Test for some failure cases. |
| 595 |
func TestFailure(t *testing.T) { |
| 596 |
for _, test := range failureTests { |
| 597 |
got, err := ToString(test.input) |
| 598 |
if err == nil { |
| 599 |
t.Errorf("unexpected success for %s: %s", test.input, got) |
| 600 |
} else if !strings.Contains(err.Error(), test.error) { |
| 601 |
t.Errorf("unexpected error for %s: %v", test.input, err) |
| 602 |
} else { |
| 603 |
s := err.Error() |
| 604 |
i := strings.LastIndex(s, " at ") |
| 605 |
if i < 0 { |
| 606 |
t.Errorf("missing offset in error for %s: %v", test.input, err) |
| 607 |
} else { |
| 608 |
off, oerr := strconv.Atoi(s[i+4:]) |
| 609 |
if oerr != nil { |
| 610 |
t.Errorf("can't parse offset (%s) for %s: %v", s[i+4:], test.input, err) |
| 611 |
} else if off != test.off { |
| 612 |
t.Errorf("unexpected offset for %s: got %d, want %d", test.input, off, test.off) |
| 613 |
} |
| 614 |
} |
| 615 |
} |
| 616 |
|
| 617 |
if got := Filter(test.input); got != test.input { |
| 618 |
t.Errorf("Filter(%s) == %s, want %s", test.input, got, test.input) |
| 619 |
} |
| 620 |
} |
| 621 |
} |
| 622 |
|
| 623 |
func TestMaxLength(t *testing.T) { |
| 624 |
if isMaxLength(Option(0)) { |
| 625 |
t.Errorf("isMaxLength(0) returned true") |
| 626 |
} |
| 627 |
for pow := 1; pow <= 30; pow++ { |
| 628 |
opt := MaxLength(pow) |
| 629 |
if !isMaxLength(opt) { |
| 630 |
t.Errorf("isMaxLength(%x) returned false", opt) |
| 631 |
} |
| 632 |
if got := maxLength(opt); got != 1<<pow { |
| 633 |
t.Errorf("maxLength(%x) = %v, want %v", opt, got, 1<<pow) |
| 634 |
} |
| 635 |
} |
| 636 |
} |
| 637 |
|
| 638 |
// The user's options slice should not change. |
| 639 |
func TestOptionsSlice(t *testing.T) { |
| 640 |
opts := []Option{NoTemplateParams, NoParams, NoEnclosingParams} |
| 641 |
saved := append([]Option{}, opts...) |
| 642 |
input := "_GLOBAL__I__Z2fnv" |
| 643 |
got, err := ToString(input, opts...) |
| 644 |
if err != nil { |
| 645 |
t.Fatal(err) |
| 646 |
} |
| 647 |
want := "global constructors keyed to fn()" |
| 648 |
if got != want { |
| 649 |
t.Errorf("ToString(%q) = %q, want %q", input, got, want) |
| 650 |
} |
| 651 |
for i, opt := range opts { |
| 652 |
if opt != saved[i] { |
| 653 |
t.Errorf("options[%d] = %d, want %d", i, opt, saved[i]) |
| 654 |
} |
| 655 |
} |
| 656 |
} |