mangle.c (write_member_name): Move abi-version=1 code back to...

* mangle.c (write_member_name): Move abi-version=1 code back to...
	(write_expression): ...here.

From-SVN: r155398
This commit is contained in:
Jason Merrill 2009-12-22 09:28:55 -05:00 committed by Jason Merrill
parent 54700aa6c9
commit e5408216a1
4 changed files with 23 additions and 14 deletions

View File

@ -1,3 +1,8 @@
2009-12-21 Jason Merrill <jason@redhat.com>
* mangle.c (write_member_name): Move abi-version=1 code back to...
(write_expression): ...here.
2009-12-16 Jason Merrill <jason@redhat.com>
PR c++/42387

View File

@ -2110,12 +2110,7 @@ write_member_name (tree member)
if (TREE_CODE (member) == IDENTIFIER_NODE)
write_source_name (member);
else if (DECL_P (member))
{
/* G++ 3.2 incorrectly put out both the "sr" code and
the nested name of the qualified name. */
G.need_abi_warning = 1;
write_unqualified_name (member);
}
write_unqualified_name (member);
else if (TREE_CODE (member) == TEMPLATE_ID_EXPR)
{
tree name = TREE_OPERAND (member, 0);
@ -2213,17 +2208,27 @@ write_expression (tree expr)
write_string ("at");
write_type (TREE_OPERAND (expr, 0));
}
else if (abi_version_at_least (2) && TREE_CODE (expr) == SCOPE_REF)
else if (TREE_CODE (expr) == SCOPE_REF)
{
tree scope = TREE_OPERAND (expr, 0);
tree member = TREE_OPERAND (expr, 1);
if (!abi_version_at_least (2))
{
write_string ("sr");
write_type (scope);
/* G++ 3.2 incorrectly put out both the "sr" code and
the nested name of the qualified name. */
G.need_abi_warning = 1;
write_encoding (member);
}
/* If the MEMBER is a real declaration, then the qualifying
scope was not dependent. Ideally, we would not have a
SCOPE_REF in those cases, but sometimes we do. If the second
argument is a DECL, then the name must not have been
dependent. */
if (DECL_P (member))
else if (DECL_P (member))
write_expression (member);
else
{
@ -2388,12 +2393,6 @@ write_expression (tree expr)
sorry ("mangling new-expression");
break;
/* Handle pointers-to-members specially. */
case SCOPE_REF:
write_type (TREE_OPERAND (expr, 0));
write_member_name (TREE_OPERAND (expr, 1));
break;
default:
for (i = 0; i < TREE_OPERAND_LENGTH (expr); ++i)
{

View File

@ -1,3 +1,7 @@
2009-12-21 Jason Merrill <jason@redhat.com>
* g++.dg/abi/mangle14.C: Add expected mangling.
2009-12-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/PR42422

View File

@ -1,5 +1,6 @@
// { dg-do compile }
// { dg-options "-Wabi -fabi-version=1" }
// { dg-final { scan-assembler "_Z1g1SIXadsr1ANS0_1fIiEEivEE" } }
struct A {
template <typename T> int f ();