diff options
author | Jason Merrill <jason@redhat.com> | 2011-08-30 17:27:27 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-08-30 17:27:27 -0400 |
commit | 90677b8d915a4abc6366d38c0470c7cf0438e18c (patch) | |
tree | 74cc8499c6c76ee2f22fcd5712ebcfcab2e0a2ad /gcc | |
parent | 971df06b2f4cd9335b34d087f82ec7a471b5871d (diff) | |
download | gcc-90677b8d915a4abc6366d38c0470c7cf0438e18c.zip gcc-90677b8d915a4abc6366d38c0470c7cf0438e18c.tar.gz gcc-90677b8d915a4abc6366d38c0470c7cf0438e18c.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/lambda/lambda-qualified.C | 17 |
4 files changed, 25 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 799fc2a..2a919ac 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index dd7c013..ce84062 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 9cc012f..cfc0a3f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. 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 0000000..ef041c2 --- /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-> + }(); + } +}; |