re PR c++/48489 (Invalid error message 'has no member named' when referring directly to the base class)

/cp
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/48489
	* typeck.c (finish_class_member_access_expr): Fix error call
	for TREE_CODE (access_path) == TREE_BINFO.

/testsuite
2011-10-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/48489
	* g++.dg/inherit/error5.C: New.

From-SVN: r180080
This commit is contained in:
Paolo Carlini 2011-10-17 09:48:02 +00:00 committed by Paolo Carlini
parent fbe468a522
commit 2be4314f3d
4 changed files with 28 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2011-10-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/48489
* typeck.c (finish_class_member_access_expr): Fix error call
for TREE_CODE (access_path) == TREE_BINFO.
2011-10-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50732

View file

@ -2591,7 +2591,9 @@ finish_class_member_access_expr (tree object, tree name, bool template_p,
if (member == NULL_TREE)
{
if (complain & tf_error)
error ("%qD has no member named %qE", object_type, name);
error ("%qD has no member named %qE",
TREE_CODE (access_path) == TREE_BINFO
? TREE_TYPE (access_path) : object_type, name);
return error_mark_node;
}
if (member == error_mark_node)

View file

@ -1,3 +1,8 @@
2011-10-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/48489
* g++.dg/inherit/error5.C: New.
2011-10-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/47023

View file

@ -0,0 +1,14 @@
// PR c++/48489
struct Base{ };
struct Concrete : Base
{
void setValue();
};
int main()
{
Concrete d;
d.Base::setValue(); // { dg-error "struct Base" }
}