Commit 91914f0a by Patrick Palka

Fix PR c++/70205 (ICE on valid call to qualified static member function)

gcc/cp/ChangeLog:

	PR c++/70205
	* search.c (adjust_result_of_qualified_name_lookup): Don't
	update the BASELINK_BINFO of DECL if the second call
	to lookup_base fails.

gcc/testsuite/ChangeLog:

	PR c++/70205
	* g++.dg/lookup/pr70205.C: New test.

From-SVN: r234317
parent 753a8910
2016-03-18 Patrick Palka <ppalka@gcc.gnu.org> 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/70205
* search.c (adjust_result_of_qualified_name_lookup): Don't
update the BASELINK_BINFO of DECL if the second call
to lookup_base fails.
2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/70218 PR c++/70218
* parser.c (cp_parser_lambda_expression): Move call to * parser.c (cp_parser_lambda_expression): Move call to
pop_deferring_access_checks ahead of the call to pop_deferring_access_checks ahead of the call to
......
...@@ -1751,9 +1751,11 @@ adjust_result_of_qualified_name_lookup (tree decl, ...@@ -1751,9 +1751,11 @@ adjust_result_of_qualified_name_lookup (tree decl,
if (base && base != error_mark_node) if (base && base != error_mark_node)
{ {
BASELINK_ACCESS_BINFO (decl) = base; BASELINK_ACCESS_BINFO (decl) = base;
BASELINK_BINFO (decl) tree decl_binfo
= lookup_base (base, BINFO_TYPE (BASELINK_BINFO (decl)), = lookup_base (base, BINFO_TYPE (BASELINK_BINFO (decl)),
ba_unique, NULL, tf_none); ba_unique, NULL, tf_none);
if (decl_binfo && decl_binfo != error_mark_node)
BASELINK_BINFO (decl) = decl_binfo;
} }
} }
......
2016-03-18 Patrick Palka <ppalka@gcc.gnu.org> 2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/70205
* g++.dg/lookup/pr70205.C: New test.
2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/70218 PR c++/70218
* g++.dg/cpp0x/lambda/lambda-70218.C: New test. * g++.dg/cpp0x/lambda/lambda-70218.C: New test.
......
// PR c++/70205
struct A
{
protected:
static void f ();
};
struct B : A { };
struct C : A { };
struct D : C, B { void a () { D::f (); } };
struct E : D { void b () { D::f (); } };
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