summaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 81ac4ad1b22..97d4309fcf2 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2203,12 +2203,20 @@ write_template_arg (tree node)
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');
}