summaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-08 10:11:09 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-08 10:11:09 +0000
commit6195c0dd4e15f50ac89491b48e050751f8231304 (patch)
tree1f49de2cfcd902f18c22b5539315d7b0fb4db972 /gcc/cp/mangle.c
parentd7ce7f9586bca838e0dcc7e39100ffe6edcd74f3 (diff)
downloadgcc-6195c0dd4e15f50ac89491b48e050751f8231304.tar.gz
2012-03-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk [future 4.8] rev 185094 using svnmerge 2011-03-08 Basile Starynkevitch <basile@starynkevitch.net> [gcc/] * melt-build.tpl (meltframe.args): Add -Iinclude-fixed if it exists. * melt-build.mk: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@185096 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 34f19efc42e..5d6beb5d578 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -942,7 +942,7 @@ write_nested_name (const tree decl)
}
else
{
- write_prefix (CP_DECL_CONTEXT (decl));
+ write_prefix (decl_mangling_context (decl));
write_unqualified_name (decl);
}
}
@@ -1030,7 +1030,7 @@ write_prefix (const tree node)
}
else
{
- write_prefix (CP_DECL_CONTEXT (decl));
+ write_prefix (decl_mangling_context (decl));
write_unqualified_name (decl);
}
}
@@ -1060,7 +1060,7 @@ write_template_prefix (const tree node)
{
tree decl = DECL_P (node) ? node : TYPE_NAME (node);
tree type = DECL_P (node) ? TREE_TYPE (node) : node;
- tree context = CP_DECL_CONTEXT (decl);
+ tree context = decl_mangling_context (decl);
tree template_info;
tree templ;
tree substitution;
@@ -1292,18 +1292,16 @@ write_source_name (tree identifier)
}
/* Write a user-defined literal operator.
+ ::= li <source-name> # "" <source-name>
IDENTIFIER is an LITERAL_IDENTIFIER_NODE. */
static void
write_literal_operator_name (tree identifier)
{
const char* suffix = UDLIT_OP_SUFFIX (identifier);
- char* buffer = XNEWVEC (char, strlen (UDLIT_OP_MANGLED_PREFIX)
- + strlen (suffix) + 10);
- sprintf (buffer, UDLIT_OP_MANGLED_FORMAT, suffix);
-
- write_unsigned_number (strlen (buffer));
- write_identifier (buffer);
+ write_identifier (UDLIT_OP_MANGLED_PREFIX);
+ write_unsigned_number (strlen (suffix));
+ write_identifier (suffix);
}
/* Encode 0 as _, and 1+ as n-1_. */
@@ -2808,7 +2806,17 @@ write_expression (tree expr)
if (name == NULL)
{
- sorry ("mangling %C", code);
+ switch (code)
+ {
+ case TRAIT_EXPR:
+ error ("use of built-in trait %qE in function signature; "
+ "use library traits instead", expr);
+ break;
+
+ default:
+ sorry ("mangling %C", code);
+ break;
+ }
return;
}
else