Commit c8a65a25 by Mark Mitchell Committed by Mark Mitchell

re PR c++/12486 (Accepts IMHO invalid C++ code)

	PR c++/12486
	* typeck.c (finish_class_member_access_expr): Issue diagnostic
	on erroneous use of qualified name.

	PR c++/12486
	* g++.dg/inherit/error1.C: New test.

From-SVN: r72052
parent bb1b12ec
2003-10-02 Mark Mitchell <mark@codesourcery.com>
PR c++/12486
* typeck.c (finish_class_member_access_expr): Issue diagnostic
on erroneous use of qualified name.
2003-09-30 Richard Henderson <rth@redhat.com>
* decl.c (duplicate_decls): Copy DECL_SAVED_INSNS too.
......
......@@ -1888,8 +1888,13 @@ finish_class_member_access_expr (tree object, tree name)
/* Find the base of OBJECT_TYPE corresponding to SCOPE. */
access_path = lookup_base (object_type, scope, ba_check, NULL);
if (!access_path || access_path == error_mark_node)
if (access_path == error_mark_node)
return error_mark_node;
if (!access_path)
{
error ("`%T' is not a base of `%T'", scope, object_type);
return error_mark_node;
}
}
else
{
......
2003-10-02 Mark Mitchell <mark@codesourcery.com>
PR c++/12486
* g++.dg/inherit/error1.C: New test.
2003-10-02 Chris Demetriou <cgd@broadcom.com>
* lib/f-torture.exp (search_for): Rename to...
......
// PR 12486
struct A { int ma; };
struct B { };
void foo()
{
B *b;
b->A::ma=0; // { dg-error "" }
}
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