summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorKamlesh Kumar <kamleshbhalui@gmail.com>2019-11-04 23:24:25 +0000
committerJason Merrill <jason@gcc.gnu.org>2019-11-04 18:24:25 -0500
commite0c866ddfdb500cacefee4e37fb3e85521c55623 (patch)
tree97bd2e1b1e838cc820f21aaee225bf416616c1e3 /libiberty
parent04373f9288435fa2980dda99ad988fa5ce99331a (diff)
PR c++/91979 - mangling nullptr expression
2019-11-04 Kamlesh Kumar <kamleshbhalui@gmail.com> gcc/cp * cp/mangle.c (write_template_arg_literal): Handle nullptr mangling. gcc * common.opt (-fabi-version): Document =14. * doc/invoke.texi (C++ Dialect Options): Likewise. gcc/c-family * c-opts.c (c_common_post_options): Update latest_abi_version. libiberty * cp-demangle.c (d_expr_primary): Handle nullptr demangling. * testsuite/demangle-expected: Added test. From-SVN: r277801
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog6
-rw-r--r--libiberty/cp-demangle.c11
-rw-r--r--libiberty/testsuite/demangle-expected4
3 files changed, 21 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 4992b15d681..b6f9e2de60d 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,9 @@
+2019-11-04 Kamlesh Kumar <kamleshbhalui@gmail.com>
+
+ * cp-demangle.c (d_expr_primary): Handle
+ nullptr demangling.
+ * testsuite/demangle-expected: Added test.
+
2019-10-29 Paul Pluzhnikov <ppluzhnikov@google.com>
* cp-demangle.c (d_number): Avoid signed int overflow.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 5b674d7d93c..963217c37bd 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -3577,6 +3577,17 @@ d_expr_primary (struct d_info *di)
&& type->u.s_builtin.type->print != D_PRINT_DEFAULT)
di->expansion -= type->u.s_builtin.type->len;
+ if (type->type == DEMANGLE_COMPONENT_BUILTIN_TYPE
+ && strcmp (type->u.s_builtin.type->name,
+ cplus_demangle_builtin_types[33].name) == 0)
+ {
+ if (d_peek_char (di) == 'E')
+ {
+ d_advance (di, 1);
+ return type;
+ }
+ }
+
/* Rather than try to interpret the literal value, we just
collect it as a string. Note that it's possible to have a
floating point literal here. The ABI specifies that the
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 61681484d0e..f68a8a71aaf 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -1446,3 +1446,7 @@ Foo<int>()::X::fn
_ZZZ3FooIiEfvENKUlT_E_clIcEEDaS0_EN1X2fnEv
Foo<int>()::{lambda(auto:1)#1}::operator()<char>(char) const::X::fn()
Foo<int>()::{lambda(auto:1)#1}::operator()<char>(char) const::X::fn
+#PR91979 demangling nullptr expression
+
+_Z3fooILPv0EEvPN9enable_ifIXeqT_LDnEEvE4typeE
+void foo<(void*)0>(enable_if<((void*)0)==((decltype(nullptr))), void>::type*)