Commit 2be4314f by Paolo Carlini Committed by Paolo Carlini

re PR c++/48489 (Invalid error message 'has no member named' when referring…

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
parent fbe468a5
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> 2011-10-15 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50732 PR c++/50732
......
...@@ -2591,7 +2591,9 @@ finish_class_member_access_expr (tree object, tree name, bool template_p, ...@@ -2591,7 +2591,9 @@ finish_class_member_access_expr (tree object, tree name, bool template_p,
if (member == NULL_TREE) if (member == NULL_TREE)
{ {
if (complain & tf_error) 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; return error_mark_node;
} }
if (member == error_mark_node) if (member == error_mark_node)
......
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> 2011-10-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/47023 PR fortran/47023
......
// PR c++/48489
struct Base{ };
struct Concrete : Base
{
void setValue();
};
int main()
{
Concrete d;
d.Base::setValue(); // { dg-error "struct Base" }
}
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