demangle.h (qualifier_list<Allocator>::decode_qualifiers(string_type&, string_type...
authorCarlo Wood <carlo@alinoe.com>
Fri, 7 Nov 2003 03:53:44 +0000 (03:53 +0000)
committerCarlo Wood <carlo@gcc.gnu.org>
Fri, 7 Nov 2003 03:53:44 +0000 (03:53 +0000)
* 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

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/demangle.h
libstdc++-v3/testsuite/demangle/abi_examples/10.cc
libstdc++-v3/testsuite/demangle/regression/3111-2.cc
libstdc++-v3/testsuite/demangle/regression/7986-01.cc
libstdc++-v3/testsuite/demangle/regression/7986-07.cc

index 68c8571e440fcf5090e35cf5fd7d1684536a56bd..1563a6d480efd9447ed54c88989f7e798817d11b 100644 (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
index 901eaa7e1b8a424d7040e789e1ef704213478484..28581662db1767d3ac039fa6d399756e1ee359f8 100644 (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':
index fc422a7cd04dac4591afca1e98f6a5787b4007d8..d639ca826b93c8128b62ba6508f5d11b9c1ad83e 100644 (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;
 }
index 8897c5069a174dda3cf8fee27a72b52e508bc3b7..42d50f4c1aad24f9329657b8492c6e297f493a57 100644 (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;
 }
index e864957db390f5a5775adb9485f059fcdebbd1fe..46551e77fc7dfa7559460e12722432dacfe99363 100644 (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;
 }
index 6a4dfb05024daae01cf1d27b45eb56e9172f83db..e0352567b00b4279702c4005c337d4656269d795 100644 (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;