re PR c++/50089 ([C++0x] ICE when calling a qualified base class member function...
authorJason Merrill <jason@redhat.com>
Tue, 30 Aug 2011 21:27:27 +0000 (17:27 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 30 Aug 2011 21:27:27 +0000 (17:27 -0400)
PR c++/50089
* semantics.c (finish_id_expression): Use
current_nonlambda_class_type for qualified-ids.

From-SVN: r178339

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 799fc2a5d4717d825e6b8fe38c5fdd359085ccd2..2a919ac8b05bfa7f34eefe9d1b7af98eaf729ddc 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 dd7c01373b56781322962bd12c1ac87f8552379f..ce84062f91812a8639a9bfec96e62d72ac1f6ead 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 9cc012f5fbfb0ee30aeeae83b57a97de5eb76ba1..cfc0a3fb98e95ce1dcce6aa65f8477c36ee496c4 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->
+    }();
+  }
+};