merge from gcc
authorDJ Delorie <dj@redhat.com>
Thu, 6 May 2010 21:40:04 +0000 (21:40 +0000)
committerDJ Delorie <dj@redhat.com>
Thu, 6 May 2010 21:40:04 +0000 (21:40 +0000)
libiberty/ChangeLog
libiberty/cp-demangle.c
libiberty/cp-demangle.h
libiberty/testsuite/demangle-expected

index cf4cdc45aa5517cdf287a014d9e28e805c92b71d..4414e04792f7d89f5a0eafda1dbf47983b4e528d 100644 (file)
@@ -1,3 +1,10 @@
+2010-05-06  Magnus Fromreide  <magfr@lysator.liu.se>
+           Jason Merrill  <jason@redhat.com>
+
+       * cp-demangle.c (cplus_demangle_builtin_types): Add nullptr.
+       (cplus_demangle_type): Handle nullptr.
+       * testsuite/demangle-expected: Test it.
+
 2010-04-23  Pedro Alves  <pedro@codesourcery.com>
 
        * lbasename.c (lbasename): Split into ...
index 98c64db552f8642eb328798d78125e2e62455237..6db1f78be3c8653556e70e324bc8929a1bfbdd86 100644 (file)
@@ -1987,6 +1987,8 @@ cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT] =
   /* 29 */ { NL ("half"),      NL ("half"),            D_PRINT_FLOAT },
   /* 30 */ { NL ("char16_t"),  NL ("char16_t"),        D_PRINT_DEFAULT },
   /* 31 */ { NL ("char32_t"),  NL ("char32_t"),        D_PRINT_DEFAULT },
+  /* 32 */ { NL ("decltype(nullptr)"), NL ("decltype(nullptr)"),
+            D_PRINT_DEFAULT },
 };
 
 CP_STATIC_IF_GLIBCPP_V3
@@ -2221,6 +2223,12 @@ cplus_demangle_type (struct d_info *di)
          ret = d_vector_type (di);
          break;
 
+        case 'n':
+          /* decltype(nullptr) */
+         ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[32]);
+         di->expansion += ret->u.s_builtin.type->len;
+         break;
+
        default:
          return NULL;
        }
index aad37437400248a744566566c9a1a7e57c525906..eac054ed1e290613219e7b771d6172df7cc14dcd 100644 (file)
@@ -147,7 +147,7 @@ struct d_info
 extern const struct demangle_operator_info cplus_demangle_operators[];
 #endif
 
-#define D_BUILTIN_TYPE_COUNT (32)
+#define D_BUILTIN_TYPE_COUNT (33)
 
 CP_STATIC_IF_GLIBCPP_V3
 const struct demangle_builtin_type_info
index 672f35216fe4953cbc8d3ae0f4869b8e9c35eceb..a3331c45ee8374192bd8e59b738fd0f9cd49841f 100644 (file)
@@ -3938,6 +3938,9 @@ decltype ((operator+)({parm#1}, {parm#1})) f<A>(A)
 --format=gnu-v3
 _Z1hI1AEDTcldtfp_miEET_
 decltype (({parm#1}.(operator-))()) h<A>(A)
+--format=gnu-v3
+_Z1fDn
+f(decltype(nullptr))
 #
 # Ada (GNAT) tests.
 #