OSDN Git Service

PR c++/50089
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Aug 2011 21:27:27 +0000 (21:27 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Aug 2011 21:27:27 +0000 (21:27 +0000)
* semantics.c (finish_id_expression): Use
current_nonlambda_class_type for qualified-ids.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178339 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-qualified.C [new file with mode: 0644]

index 799fc2a..2a919ac 100644 (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.
index dd7c013..ce84062 100644 (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);
index 9cc012f..cfc0a3f 100644 (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.
 
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 (file)
index 0000000..ef041c2
--- /dev/null
@@ -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->
+    }();
+  }
+};