8sa1-gcc/gcc/testsuite/g++.old-deja/g++.other/lookup18.C
Jason Merrill 477f6664a4 pt.c (tsubst_decl): A FUNCTION_DECL has DECL_RESULT, not DECL_TEMPLATE_RESULT.
* pt.c (tsubst_decl): A FUNCTION_DECL has DECL_RESULT, not
        DECL_TEMPLATE_RESULT.

        * search.c (lookup_field_r): Call lookup_fnfields_1, not
        lookup_fnfields_here.

        * parse.y (typename_sub2): Return the TYPE_DECL, not the type.

        * call.c (build_object_call): Also allow conversions that return
        reference to pointer to function.
        (add_conv_candidate): Handle totype being ref to ptr to fn.
        (build_field_call): Also allow members of type reference to function.
        Lose support for calling pointer to METHOD_TYPE fields.

        * error.c (dump_expr): Handle *_CAST_EXPR.

        * typeck2.c (build_scoped_ref): Always convert to the naming class.

        * tree.c (break_out_cleanups): Lose.
        * cp-tree.h: Remove prototype.
        * typeck.c (build_component_ref): Don't break_out_cleanups.
        (build_compound_expr): Likewise.
        * semantics.c (finish_expr_stmt): Likewise.

From-SVN: r38417
2000-12-21 12:50:10 -05:00

24 lines
419 B
C

// Test that referring to an ambiguous base in name lookup prevents
// access to the field, even though the field is not ambiguous.
// Build don't link:
struct A {
int i;
};
struct B: virtual A { };
struct C: public B { };
struct D: public B { };
struct E: public C, public D {
void f ();
};
void E::f() {
B::i = 0; // ERROR - B is ambiguous
}
void f () {
E e;
e.B::i = 0; // ERROR - B is ambiguous
}