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
This commit is contained in:
Mark Mitchell 2003-10-02 23:14:01 +00:00 committed by Mark Mitchell
parent bb1b12ec0a
commit c8a65a2563
4 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,9 @@
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.

View File

@ -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
{

View File

@ -1,3 +1,8 @@
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...

View File

@ -0,0 +1,10 @@
// PR 12486
struct A { int ma; };
struct B { };
void foo()
{
B *b;
b->A::ma=0; // { dg-error "" }
}