aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-05-16 23:46:40 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-05-16 23:46:40 +0000
commit74322f31ce1569e43d0e9a8050cc151ab810d22e (patch)
tree62fedcf7783daa5232bb7defd83e10669f7ed3bd /gcc/cp/decl2.c
parentb283d5d71650d467e84cad93f4db09705ebaca22 (diff)
downloadgcc-74322f31ce1569e43d0e9a8050cc151ab810d22e.zip
gcc-74322f31ce1569e43d0e9a8050cc151ab810d22e.tar.gz
gcc-74322f31ce1569e43d0e9a8050cc151ab810d22e.tar.bz2
decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that indicate a reference to a field that is a qualified name.
* decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that indicate a reference to a field that is a qualified name. From-SVN: r26956
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 6a7e14f..bb24014d 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -4056,10 +4056,22 @@ build_expr_from_tree (t)
}
case COMPONENT_REF:
- return build_x_component_ref
- (build_expr_from_tree (TREE_OPERAND (t, 0)),
- TREE_OPERAND (t, 1), NULL_TREE, 1);
-
+ {
+ tree object = build_expr_from_tree (TREE_OPERAND (t, 0));
+ tree field = TREE_OPERAND (t, 1);
+
+ /* We use a COMPONENT_REF to indicate things of the form `x.b'
+ and `x.A::b'. We must distinguish between those cases
+ here. */
+ if (TREE_CODE (field) == SCOPE_REF)
+ return build_object_ref (object,
+ TREE_OPERAND (field, 0),
+ TREE_OPERAND (field, 1));
+ else
+ return build_x_component_ref (object, field,
+ NULL_TREE, 1);
+ }
+
case THROW_EXPR:
return build_throw (build_expr_from_tree (TREE_OPERAND (t, 0)));