summaryrefslogtreecommitdiff
path: root/gcc/cp/mangle.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-21 21:35:09 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2014-11-21 21:35:09 +0000
commit94810e461aa90f636e3b4834b5c6af955ea10078 (patch)
treeafc767f7d032ad609b159c2bb96444301e867ef9 /gcc/cp/mangle.c
parente422db1ce317d8a8938da375a6c35a1a1ce883d4 (diff)
downloadgcc-94810e461aa90f636e3b4834b5c6af955ea10078.tar.gz
PR c++/63942
* name-lookup.c (supplement_binding_1): Override a mangling alias. * mangle.c (implicit_alias_p, remove_implicit_alias): New. (mangle_decl): Avoid creating conflicting alias with -fabi-compat-version=0, too. * cp-tree.h: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217950 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r--gcc/cp/mangle.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 9f0d9d8ed77..a24466994f0 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -3428,6 +3428,28 @@ get_mangled_id (tree decl)
return targetm.mangle_decl_assembler_name (decl, id);
}
+/* If DECL is a mangling alias, remove it from the symbol table and return
+ true; otherwise return false. */
+
+bool
+maybe_remove_implicit_alias (tree decl)
+{
+ if (DECL_P (decl) && DECL_ARTIFICIAL (decl)
+ && DECL_IGNORED_P (decl)
+ && (TREE_CODE (decl) == FUNCTION_DECL
+ || (TREE_CODE (decl) == VAR_DECL
+ && TREE_STATIC (decl))))
+ {
+ symtab_node *n = symtab_node::get (decl);
+ if (n && n->cpp_implicit_alias)
+ {
+ n->remove();
+ return true;
+ }
+ }
+ return false;
+}
+
/* Create an identifier for the external mangled name of DECL. */
void
@@ -3491,8 +3513,9 @@ mangle_decl (const tree decl)
}
#ifdef ASM_OUTPUT_DEF
- if (flag_abi_compat_version != 0
- && IDENTIFIER_GLOBAL_VALUE (id2))
+ /* If there's a declaration already using this mangled name,
+ don't create a compatibility alias that conflicts. */
+ if (IDENTIFIER_GLOBAL_VALUE (id2))
return;
tree alias = make_alias_for (decl, id2);