[Bug c++/91979] Incorrect mangling for non-template-argument nullptr expression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91979 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |10.0 Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #6 from Andrew Pinski --- Fixed for GCC 10.
[Bug c++/91979] Incorrect mangling for non-template-argument nullptr expression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91979 --- Comment #5 from Jason Merrill --- Author: jason Date: Mon Nov 4 23:24:25 2019 New Revision: 277801 URL: https://gcc.gnu.org/viewcvs?rev=277801=gcc=rev Log: PR c++/91979 - mangling nullptr expression 2019-11-04 Kamlesh Kumar 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. Added: trunk/gcc/testsuite/g++.dg/cpp0x/nullptr43.C - copied, changed from r277799, trunk/gcc/testsuite/g++.dg/cpp0x/nullptr27.C trunk/gcc/testsuite/g++.dg/cpp0x/nullptr44.C Modified: trunk/gcc/ChangeLog trunk/gcc/c-family/ChangeLog trunk/gcc/c-family/c-opts.c trunk/gcc/common.opt trunk/gcc/cp/ChangeLog trunk/gcc/cp/mangle.c trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/g++.dg/abi/macro0.C trunk/gcc/testsuite/g++.dg/cpp0x/nullptr27.C trunk/libiberty/ChangeLog trunk/libiberty/cp-demangle.c trunk/libiberty/testsuite/demangle-expected
[Bug c++/91979] Incorrect mangling for non-template-argument nullptr expression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91979 --- Comment #4 from Kamlesh Kumar --- patch posted at https://gcc.gnu.org/ml/gcc-patches/2019-10/msg01585.html
[Bug c++/91979] Incorrect mangling for non-template-argument nullptr expression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91979 --- Comment #3 from Jonathan Wakely --- Thanks, once you have a copyright assignment on file please post to the gcc-patches list with a testcase. This might need a new -fabi-version to preserve the old mangling for compatibility, but I'll let Jason determine that.
[Bug c++/91979] Incorrect mangling for non-template-argument nullptr expression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91979 Kamlesh Kumar changed: What|Removed |Added CC||kamleshbhalui at gmail dot com --- Comment #2 from Kamlesh Kumar --- This fixes it. diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index a9333b8..780da9f 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -3400,7 +3400,8 @@ write_template_arg_literal (const tree value) case INTEGER_CST: gcc_assert (!same_type_p (TREE_TYPE (value), boolean_type_node) || integer_zerop (value) || integer_onep (value)); - write_integer_cst (value); + if (TREE_CODE(TREE_TYPE(value)) != NULLPTR_TYPE) + write_integer_cst (value); break; case REAL_CST: diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index aa78c86..199be43 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -861,7 +861,7 @@ CP_STATIC_IF_GLIBCPP_V3 int cplus_demangle_fill_name (struct demangle_component *p, const char *s, int len) { - if (p == NULL || s == NULL || len <= 0) + if (p == NULL || s == NULL || len < 0) return 0; p->d_printing = 0; p->type = DEMANGLE_COMPONENT_NAME;
[Bug c++/91979] Incorrect mangling for non-template-argument nullptr expression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91979 Jonathan Wakely changed: What|Removed |Added Keywords||ABI --- Comment #1 from Jonathan Wakely --- GCC trunk still produces LDn0E. EDG agrees with Clang (and the ABI spec).
[Bug c++/91979] Incorrect mangling for non-template-argument nullptr expression
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91979 Jonathan Wakely changed: What|Removed |Added Keywords||wrong-code Status|UNCONFIRMED |NEW Last reconfirmed||2019-10-03 Ever confirmed|0 |1