From: Jason Merrill Date: Tue, 30 Aug 2011 21:27:27 +0000 (-0400) Subject: re PR c++/50089 ([C++0x] ICE when calling a qualified base class member function... X-Git-Tag: releases/gcc-4.7.0~4087 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90677b8d915a4abc6366d38c0470c7cf0438e18c;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 799fc2a5d471..2a919ac8b05b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2011-08-30 Jason Merrill + 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. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index dd7c01373b56..ce84062f9181 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9cc012f5fbfb..cfc0a3fb98e9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2011-08-30 Jason Merrill + PR c++/50089 + * g++.dg/cpp0x/lambda/lambda-qualified.C: New. + PR c++/50114 * g++.dg/cpp0x/lambda/lambda-for.C: New. diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-qualified.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-qualified.C new file mode 100644 index 000000000000..ef041c2bb900 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-qualified.C @@ -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-> + }(); + } +};