parse.y (parse_finish_call_expr): Check lookup_member result.

cp:
	* parse.y (parse_finish_call_expr): Check lookup_member result.
testsuite:
	* g++.dg/lookup/scoped2.C: New test.

From-SVN: r57195
This commit is contained in:
Nathan Sidwell 2002-09-16 15:15:36 +00:00 committed by Nathan Sidwell
parent 28c56d2569
commit 7979434d1d
4 changed files with 29 additions and 0 deletions

View File

@ -1,5 +1,7 @@
2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
* parse.y (parse_finish_call_expr): Check lookup_member result.
PR c++/7015
* semantic.c (finish_asm_stmt): Fix operand/output_operands
thinko.

View File

@ -4177,6 +4177,12 @@ parse_finish_call_expr (tree fn, tree args, int koenig)
name = DECL_NAME (get_first_fn (name));
fn = lookup_member (scope, name, /*protect=*/1,
/*prefer_type=*/0);
if (!fn)
{
error ("'%D' has no member named '%E'", scope, name);
return error_mark_node;
}
if (BASELINK_P (fn) && template_id)
BASELINK_FUNCTIONS (fn)
= build_nt (TEMPLATE_ID_EXPR,

View File

@ -1,5 +1,7 @@
2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/lookup/scoped2.C: New test.
* g++.dg/ext/asm3.C: New test.
2002-09-16 Richard Earnshaw <rearnsha@arm.com>

View File

@ -0,0 +1,19 @@
// { dg-do compile }
// Copyright (C) 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 16 Sep 2002 <nathan@codesourcery.com>
// Seg faulted.
struct Base
{
};
struct Derived : Base
{
void Foo ()
{
Base::Baz (); // { dg-error "has no member" "" }
};
};