aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-01-12 12:27:07 -0500
committerJason Merrill <jason@gcc.gnu.org>2012-01-12 12:27:07 -0500
commit4643a68ec2e8c5b8fcce324a74fe83a87a976d0a (patch)
treee022c1411935ef78bc54c9da036fa7beb4902383 /gcc/cp
parentca5333f22c94c1ad873265bde286cf9b96df5ff2 (diff)
downloadgcc-4643a68ec2e8c5b8fcce324a74fe83a87a976d0a.zip
gcc-4643a68ec2e8c5b8fcce324a74fe83a87a976d0a.tar.gz
gcc-4643a68ec2e8c5b8fcce324a74fe83a87a976d0a.tar.bz2
re PR c++/48051 (sorry, unimplemented: mangling overload)
PR c++/48051 * mangle.c (write_expression): Mangle BASELINK scope if BASELINK_QUALIFIED_P. * search.c (adjust_result_of_qualified_name_lookup): Set BASELINK_QUALIFIED_P. * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P. * parser.c (cp_parser_postfix_dot_deref_expression): Don't call adjust_result_of_qualified_name_lookup for non-qualified names. From-SVN: r183133
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/mangle.c20
-rw-r--r--gcc/cp/parser.c4
-rw-r--r--gcc/cp/search.c3
-rw-r--r--gcc/cp/tree.c1
5 files changed, 31 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9af1a14..6047df3 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,14 @@
2012-01-12 Jason Merrill <jason@redhat.com>
+ PR c++/48051
+ * mangle.c (write_expression): Mangle BASELINK scope if
+ BASELINK_QUALIFIED_P.
+ * search.c (adjust_result_of_qualified_name_lookup): Set
+ BASELINK_QUALIFIED_P.
+ * tree.c (cp_tree_equal) [BASELINK]: Compare BASELINK_QUALIFIED_P.
+ * parser.c (cp_parser_postfix_dot_deref_expression): Don't call
+ adjust_result_of_qualified_name_lookup for non-qualified names.
+
PR c++/51403
* pt.c (unify): Handle error_mark_node.
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 60b1870..5f2fa15 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -2500,7 +2500,9 @@ write_expression (tree expr)
code = TREE_CODE (expr);
}
- if (code == BASELINK)
+ if (code == BASELINK
+ && (!type_unknown_p (expr)
+ || !BASELINK_QUALIFIED_P (expr)))
{
expr = BASELINK_FUNCTIONS (expr);
code = TREE_CODE (expr);
@@ -2583,10 +2585,20 @@ write_expression (tree expr)
write_string ("at");
write_type (TREE_OPERAND (expr, 0));
}
- else if (TREE_CODE (expr) == SCOPE_REF)
+ else if (code == SCOPE_REF
+ || code == BASELINK)
{
- tree scope = TREE_OPERAND (expr, 0);
- tree member = TREE_OPERAND (expr, 1);
+ tree scope, member;
+ if (code == SCOPE_REF)
+ {
+ scope = TREE_OPERAND (expr, 0);
+ member = TREE_OPERAND (expr, 1);
+ }
+ else
+ {
+ scope = BINFO_TYPE (BASELINK_ACCESS_BINFO (expr));
+ member = BASELINK_FUNCTIONS (expr);
+ }
if (!abi_version_at_least (2) && DECL_P (member))
{
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index f9e1a13..4c85355 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -6045,9 +6045,9 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser,
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
}
- if (scope && name && BASELINK_P (name))
+ if (parser->scope && name && BASELINK_P (name))
adjust_result_of_qualified_name_lookup
- (name, BINFO_TYPE (BASELINK_ACCESS_BINFO (name)), scope);
+ (name, parser->scope, scope);
postfix_expression
= finish_class_member_access_expr (postfix_expression, name,
template_p,
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 45fdafc..e48dcec 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1550,6 +1550,9 @@ adjust_result_of_qualified_name_lookup (tree decl,
}
}
+ if (BASELINK_P (decl))
+ BASELINK_QUALIFIED_P (decl) = true;
+
return decl;
}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 8ef3e25..bf8bc05 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2320,6 +2320,7 @@ cp_tree_equal (tree t1, tree t2)
case BASELINK:
return (BASELINK_BINFO (t1) == BASELINK_BINFO (t2)
&& BASELINK_ACCESS_BINFO (t1) == BASELINK_ACCESS_BINFO (t2)
+ && BASELINK_QUALIFIED_P (t1) == BASELINK_QUALIFIED_P (t2)
&& cp_tree_equal (BASELINK_FUNCTIONS (t1),
BASELINK_FUNCTIONS (t2)));