diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-08-29 16:42:57 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-08-29 16:42:57 +0000 |
commit | a4a311c3b75a1a0d27e17ef26f49a4e1cbb16217 (patch) | |
tree | e67a3eb92b6792058da7ad6900b7d81789342064 /gcc/cp/mangle.c | |
parent | 839e4d28208390b3a3012e3faf2eaf9fcf992fec (diff) | |
download | gcc-a4a311c3b75a1a0d27e17ef26f49a4e1cbb16217.tar.gz |
PR c++/77379 - ABI tag on thunk
* mangle.c (maybe_check_abi_tags): Add version parm, handle thunks.
(mangle_thunk): Add thunk parameter.
* method.c (finish_thunk): Pass it.
* cp-tree.h: Declare it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239830 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r-- | gcc/cp/mangle.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index d8b5c45577f..d34743c9c68 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -231,7 +231,7 @@ static void write_local_name (tree, const tree, const tree); static void dump_substitution_candidates (void); static tree mangle_decl_string (const tree); static int local_class_index (tree); -static void maybe_check_abi_tags (tree, tree = NULL_TREE); +static void maybe_check_abi_tags (tree, tree = NULL_TREE, int = 10); static bool equal_abi_tags (tree, tree); /* Control functions. */ @@ -4024,10 +4024,13 @@ mangle_call_offset (const tree fixed_offset, const tree virtual_offset) tree mangle_thunk (tree fn_decl, const int this_adjusting, tree fixed_offset, - tree virtual_offset) + tree virtual_offset, tree thunk) { tree result; + if (abi_version_at_least (11)) + maybe_check_abi_tags (fn_decl, thunk, 11); + start_mangling (fn_decl); write_string ("_Z"); @@ -4142,7 +4145,7 @@ mangle_conv_op_name_for_type (const tree type) guard variable for T. */ static void -maybe_check_abi_tags (tree t, tree for_decl) +maybe_check_abi_tags (tree t, tree for_decl, int ver) { if (DECL_ASSEMBLER_NAME_SET_P (t)) return; @@ -4153,9 +4156,14 @@ maybe_check_abi_tags (tree t, tree for_decl) tree newtags = get_abi_tags (t); if (newtags && newtags != oldtags - && abi_version_crosses (10)) + && abi_version_crosses (ver)) { - if (for_decl) + if (for_decl && DECL_THUNK_P (for_decl)) + warning_at (DECL_SOURCE_LOCATION (t), OPT_Wabi, + "the mangled name of a thunk for %qD changes between " + "-fabi-version=%d and -fabi-version=%d", + t, flag_abi_version, warn_abi_version); + else if (for_decl) warning_at (DECL_SOURCE_LOCATION (for_decl), OPT_Wabi, "the mangled name of %qD changes between " "-fabi-version=%d and -fabi-version=%d", |