+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
// <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]
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':
{ 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;
}
// 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;
}
{
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;
}
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;