+2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
+
+ PR c++/70182
+ * doc/invoke.texi (fabi-version): Mention mangling fix for
+ operator names.
+
2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
PR c++/77489
+2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
+
+ PR c++/70182
+ * mangle.c (write_template_args): Add "on" for operator names.
+
2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
PR c++/77489
static void
write_member_name (tree member)
{
+ if (abi_version_at_least (11) && IDENTIFIER_OPNAME_P (member))
+ {
+ write_string ("on");
+ if (abi_warn_or_compat_version_crosses (11))
+ G.need_abi_warning = 1;
+ }
if (identifier_p (member))
write_unqualified_id (member);
else if (DECL_P (member))
attributes (e.g. @samp{stdcall}).
Version 11, which first appeared in G++ 7, corrects the mangling of
-sizeof... expressions. For multiple entities with the same name within
-a function, that are declared in different scopes, the mangling now
-changes starting with the eighth occurence. It also implies
-@option{-fnew-inheriting-ctors}.
+sizeof... expressions and operator names. For multiple entities with
+the same name within a function, that are declared in different scopes,
+the mangling now changes starting with the eighth occurence. It also
+implies @option{-fnew-inheriting-ctors}.
See also @option{-Wabi}.
-// { dg-options "-fabi-version=0" }
+// { dg-options "-fabi-version=10" }
struct A {
template <typename T> int f ();
// Testcase for mangling of expressions involving operator names.
// { dg-do compile { target c++11 } }
+// { dg-options "-fabi-version=10" }
// { dg-final { scan-assembler "_Z1fI1AEDTclonplfp_fp_EET_" } }
// { dg-final { scan-assembler "_Z1gI1AEDTclonplIT_Efp_fp_EES1_" } }
// { dg-final { scan-assembler "_Z1hI1AEDTcldtfp_miEET_" } }
--- /dev/null
+// { dg-options "-fabi-version=0" }
+
+struct A {
+ template <typename T> int f ();
+ int operator+();
+ operator int ();
+ template <typename T>
+ int operator-();
+};
+
+typedef int (A::*P)();
+
+template <P> struct S {};
+
+template <typename T> void g (S<&T::template f<int> >) {}
+template <typename T> void g (S<&T::operator+ >) {}
+template <typename T> void g (S<&T::operator int>) {}
+template <typename T> void g (S<&T::template operator- <double> >) {}
+
+template void g<A> (S<&A::f<int> >);
+template void g<A> (S<&A::operator+>);
+template void g<A> (S<&A::operator int>);
+template void g<A> (S<&A::operator-<double> >);
+
+// { dg-final { scan-assembler _Z1gI1AEv1SIXadsrT_1fIiEEE } }
+// { dg-final { scan-assembler _Z1gI1AEv1SIXadsrT_onplEE } }
+// { dg-final { scan-assembler _Z1gI1AEv1SIXadsrT_oncviEE } }
+// { dg-final { scan-assembler _Z1gI1AEv1SIXadsrT_onmiIdEEE } }
// { dg-do compile }
+// { dg-options "-fabi-version=10" }
// Mangling of classes from std::decimal are special-cased.
// Derived from g++.dg/abi/mangle13.C.
+2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
+
+ PR PR c++/70182
+ * cp-demangle.c (d_unqualified_name): Handle "on" for
+ operator names.
+ * testsuite/demangle-expected: Add tests.
+
2017-01-18 Markus Trippelsdorf <markus@trippelsdorf.de>
PR c++/77489
ret = d_source_name (di);
else if (IS_LOWER (peek))
{
+ if (peek == 'o' && d_peek_next_char (di) == 'n')
+ d_advance (di, 2);
ret = d_operator_name (di);
if (ret != NULL && ret->type == DEMANGLE_COMPONENT_OPERATOR)
{
_ZZ3foovE8localVar__12
_ZZ3foovE8localVar__12
+
+# PR 70182
+_Z1gI1AEv1SIXadsrT_onplEE
+void g<A>(S<&A::operator+>)
+
+_Z1gI1AEv1SIXadsrT_plEE
+void g<A>(S<&A::operator+>)