re PR c++/50089 ([C++0x] ICE when calling a qualified base class member function within a lambda expr without "this->")

PR c++/50089
	* semantics.c (finish_id_expression): Use
	current_nonlambda_class_type for qualified-ids.

From-SVN: r178339
This commit is contained in:
Jason Merrill 2011-08-30 17:27:27 -04:00 committed by Jason Merrill
parent 971df06b2f
commit 90677b8d91
4 changed files with 25 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2011-08-30 Jason Merrill <jason@redhat.com>
PR c++/50089
* semantics.c (finish_id_expression): Use
current_nonlambda_class_type for qualified-ids.
PR c++/50114
* decl.c (poplevel): Disable for scope compatibility hack
in C++11 mode.

View File

@ -3251,7 +3251,7 @@ finish_id_expression (tree id_expression,
if (scope)
{
decl = (adjust_result_of_qualified_name_lookup
(decl, scope, current_class_type));
(decl, scope, current_nonlambda_class_type()));
if (TREE_CODE (decl) == FUNCTION_DECL)
mark_used (decl);

View File

@ -1,5 +1,8 @@
2011-08-30 Jason Merrill <jason@redhat.com>
PR c++/50089
* g++.dg/cpp0x/lambda/lambda-qualified.C: New.
PR c++/50114
* g++.dg/cpp0x/lambda/lambda-for.C: New.

View File

@ -0,0 +1,17 @@
// PR c++/50089
// { dg-options -std=c++0x }
struct TestBase
{
void foo() {}
};
struct Test : TestBase
{
void foo()
{
[this]{
/*this->*/TestBase::foo(); // ICE without this->
}();
}
};