demangle.h (qualifier_list<Allocator>::decode_qualifiers(string_type&, string_type&, bool member_function_pointer_qualifiers): Always seperate the '[' of an array type with a space from what is left of it...

* include/bits/demangle.h
(qualifier_list<Allocator>::decode_qualifiers(string_type&,
string_type&, bool member_function_pointer_qualifiers):
Always seperate the '[' of an array type with a space from
what is left of it, except when that is the closing bracket
of another array dimension.

From-SVN: r73328
This commit is contained in:
Carlo Wood 2003-11-07 03:53:44 +00:00 committed by Carlo Wood
parent 2215f7320e
commit eb622d37cf
6 changed files with 19 additions and 9 deletions

View File

@ -1,3 +1,12 @@
2003-11-07 Carlo Wood <carlo@alinoe.com>
* include/bits/demangle.h
(qualifier_list<Allocator>::decode_qualifiers(string_type&,
string_type&, bool member_function_pointer_qualifiers):
Always seperate the '[' of an array type with a space from
what is left of it, except when that is the closing bracket
of another array dimension.
2003-11-07 Carlo Wood <carlo@alinoe.com>
* include/bits/demangle.h

View File

@ -1380,7 +1380,7 @@ namespace __gnu_cxx
// <Q>[K|V|r]+ ==> [ const| volatile| restrict]+Q "KVr..."
// <Q>U<S> ==> SQ "U<S>..."
// <Q>M<C> ==> C::*Q "M<C>..." (<C> recurs.)
// A<I> ==> [I] "A<I>..." (<I> recurs.)
// A<I> ==> [I] "A<I>..." (<I> recurs.)
// <Q>A<I> ==> (Q) [I] "A<I>..." (<I> recurs.)
// Note that when <Q> ends on an A<I2> then the brackets are omitted:
// A<I2>A<I> ==> [I2][I]
@ -1454,14 +1454,15 @@ namespace __gnu_cxx
case 'A':
{
string_type index = (*iter).get_optional_type();
if (++iter != M_qualifier_starts.rend()
&& (*iter).first_qualifier() != 'A')
if (++iter == M_qualifier_starts.rend())
postfix = " [" + index + "]" + postfix;
else if ((*iter).first_qualifier() == 'A')
postfix = "[" + index + "]" + postfix;
else
{
prefix += " (";
postfix = ") [" + index + "]" + postfix;
}
else
postfix = "[" + index + "]" + postfix;
break;
}
case 'M':

View File

@ -34,7 +34,7 @@ int main()
{ static int bar; };
int Foo<int[4]>::bar;
*/
verify_demangle("_ZN3FooIA4_iE3barE", "Foo<int[4]>::bar");
verify_demangle("_ZN3FooIA4_iE3barE", "Foo<int [4]>::bar");
return 0;
}

View File

@ -32,7 +32,7 @@ int main()
// verify_demangle("_Z1fAszL_ZZNK1N1A1fEvE3foo_0E_i",
// "f(int[sizeof(N::A::f() const::foo())])");
verify_demangle("_Z1fAszL_ZZNK1N1A1fEvE3foo_0E_i",
"f(int[sizeof(N::A::f() const::foo)])");
"f(int [sizeof(N::A::f() const::foo)])");
return 0;
}

View File

@ -27,7 +27,7 @@ int main()
{
using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z1fA37_iPS_", "f(int[37], int (*) [37])");
verify_demangle("_Z1fA37_iPS_", "f(int [37], int (*) [37])");
return 0;
}

View File

@ -28,7 +28,7 @@ int main()
using namespace __gnu_test;
// cplus-dem FAIL
verify_demangle("_Z3fooA30_A_i", "foo(int[30][])");
verify_demangle("_Z3fooA30_A_i", "foo(int [30][])");
return 0;