+2019-11-04 Kamlesh Kumar <kamleshbhalui@gmail.com>
+
+ * common.opt (-fabi-version): Document =14.
+ * doc/invoke.texi (C++ Dialect Options): Likewise.
+
2019-11-04 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.c (value_range_base::set): Do not special case pointers.
+2019-11-04 Kamlesh Kumar <kamleshbhalui@gmail.com>
+
+ * c-opts.c (c_common_post_options): Update
+ latest_abi_version.
+
2019-11-02 Jakub Jelinek <jakub@redhat.com>
* c-common.h (c_omp_get_context_selector): Remove.
/* Change flag_abi_version to be the actual current ABI level, for the
benefit of c_cpp_builtins, and to make comparison simpler. */
- const int latest_abi_version = 13;
+ const int latest_abi_version = 14;
/* Generate compatibility aliases for ABI v11 (7.1) by default. */
const int abi_compat_default = 11;
; 13: Fixes the accidental change in 12 to the calling convention for classes
; with deleted copy constructor and trivial move constructor.
; Default in G++ 8.2.
+; 14: Corrects the mangling of nullptr expression.
+; Default in G++ 10.
;
; Additional positive integers will be assigned as new versions of
; the ABI become the default version of the ABI.
+2019-11-04 Kamlesh Kumar <kamleshbhalui@gmail.com>
+
+ PR c++/91979 - mangling nullptr expression
+ * cp/mangle.c (write_template_arg_literal): Handle nullptr
+ mangling.
+
2019-11-04 Jason Merrill <jason@redhat.com>
* typeck.c (check_return_expr): Avoid redundant error.
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 (!(abi_version_at_least (14)
+ && NULLPTR_TYPE_P (TREE_TYPE (value))))
+ write_integer_cst (value);
break;
case REAL_CST:
Version 13, which first appeared in G++ 8.2, fixes the accidental
change in version 12.
+Version 14, which first appeared in G++ 10, corrects the mangling of
+the nullptr expression.
+
See also @option{-Wabi}.
@item -fabi-compat-version=@var{n}
// This testcase will need to be kept in sync with c_common_post_options.
// { dg-options "-fabi-version=0" }
-#if __GXX_ABI_VERSION != 1013
+#if __GXX_ABI_VERSION != 1014
#error "Incorrect value of __GXX_ABI_VERSION"
#endif
// PR c++/52706
// { dg-do compile { target c++11 } }
// { dg-options "-fabi-version=0" }
-// { dg-final { scan-assembler "_Z1fIDnLDn0EEiT_" } }
+// { dg-final { scan-assembler "_Z1fIDnLDnEEiT_" } }
template<class T, decltype(nullptr) = nullptr>
int f(T);
--- /dev/null
+// PR c++/91979
+// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=13" }
+// { dg-final { scan-assembler "_Z1fIDnLDn0EEiT_" } }
+
+template<class T, decltype(nullptr) = nullptr>
+int f(T);
+
+int i2 = f(nullptr);
--- /dev/null
+// PR c++/91979
+// { dg-do compile { target c++11 } }
+// { dg-final { scan-assembler "_Z3fooILPv0EEvPN9enable_ifIXeqT_LDnEEvE4typeE" } }
+
+template <bool, typename T = void>
+struct enable_if {};
+
+template <typename T>
+struct enable_if<true, T> { typedef T type; };
+
+template <void *P>
+void foo(typename enable_if<P == nullptr>::type* = 0) {}
+
+template void foo<(void *)0>(void *);
+
+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.
&& 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
_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*)