2004-07-02 Mark Mitchell <mark@codesourcery.com>
+ PR c++/16240
+ * mangle.c (write_template_arg): Correct mangling.
+
PR c++/16297
* decl.c (grokdeclarator): Robustify.
write_template_arg_literal (node);
else if (DECL_P (node))
{
- /* G++ 3.2 incorrectly mangled non-type template arguments of
- enumeration type using their names. */
- if (code == CONST_DECL)
+ /* Until ABI version 2, non-type template arguments of
+ enumeration type were mangled using their names. */
+ if (code == CONST_DECL && !abi_version_at_least (2))
G.need_abi_warning = 1;
write_char ('L');
- write_char ('Z');
+ /* Until ABI version 3, the underscore before the mangled name
+ was incorrectly omitted. */
+ if (!abi_version_at_least (3))
+ {
+ G.need_abi_warning = 1;
+ write_char ('Z');
+ }
+ else
+ write_string ("_Z");
write_encoding (node);
write_char ('E');
}
+2004-07-02 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/16240
+ * g++.dg/abi/mangle22.C: New test.
+ * g++.dg/abi/mangle23.C: Likewise.
+
2004-07-02 David Billinghurst (David.Billinghurst@riotinto.com)
PR fortran/16290
--- /dev/null
+// PR c++/16240
+// { dg-options "-fabi-version=3" }
+
+void foo(char);
+template<void (&)(char)> struct CB {};
+
+void g(CB<foo> i) {}
+
+// { dg-final { scan-assembler "\n_?_Z1g2CBIL_Z3foocEE\[: \t\n\]" } }
--- /dev/null
+// PR c++/16240
+// { dg-options "-fabi-version=2" }
+
+void foo(char);
+template<void (&)(char)> struct CB {};
+
+void g(CB<foo> i) {}
+
+// { dg-final { scan-assembler "\n_?_Z1g2CBILZ3foocEE\[: \t\n\]" } }