Commit 74322f31 by Mark Mitchell Committed by Mark Mitchell

decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that indicate a reference…

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
parent b283d5d7
1999-05-16 Mark Mitchell <mark@codesourcery.com>
* decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that
indicate a reference to a field that is a qualified name.
1999-05-16 Jason Merrill <jason@yorick.cygnus.com> 1999-05-16 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (finish_objects): Don't use .?tors.* if we don't have * decl2.c (finish_objects): Don't use .?tors.* if we don't have
......
...@@ -4056,10 +4056,22 @@ build_expr_from_tree (t) ...@@ -4056,10 +4056,22 @@ build_expr_from_tree (t)
} }
case COMPONENT_REF: case COMPONENT_REF:
return build_x_component_ref {
(build_expr_from_tree (TREE_OPERAND (t, 0)), tree object = build_expr_from_tree (TREE_OPERAND (t, 0));
TREE_OPERAND (t, 1), NULL_TREE, 1); 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: case THROW_EXPR:
return build_throw (build_expr_from_tree (TREE_OPERAND (t, 0))); return build_throw (build_expr_from_tree (TREE_OPERAND (t, 0)));
......
// Build don't link:
// Origin: "Artem Hodyush" <artem@duma.gov.ru>
struct B { int m; };
template< class T >
void
q( T& t ) {
t.T::m=1;
}
void f() {
B b;
b.B::m=1;
q( b );
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment