]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/27581 (ICE using this-pointer in static member function)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 15 May 2006 09:26:54 +0000 (09:26 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 15 May 2006 09:26:54 +0000 (09:26 +0000)
PR c++/27581
* search.c (adjust_result_of_qualified_name_lookup): Skip on
invalid context_class.

* g++.dg/lookup/this1.C: New test.

From-SVN: r113783

gcc/cp/ChangeLog
gcc/cp/search.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lookup/this1.C [new file with mode: 0644]

index 58d3c45765921b568790fa9788d6c2a4b6e35be7..2773248686a70e25748985d79ff4ddd6c7863e0b 100644 (file)
@@ -1,5 +1,9 @@
 2006-05-15  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/27581
+       * search.c (adjust_result_of_qualified_name_lookup): Skip on
+       invalid context_class.
+
        PR c++/27315
        * pt.c (do_decl_instantiation): Return early on invalid decl.
 
index b712fa25511fdf39679b28a24c8e012369e032c7..8a91d9a5ae73baca1515d77c71e63d6c3d1d290e 100644 (file)
@@ -1480,7 +1480,8 @@ adjust_result_of_qualified_name_lookup (tree decl,
                                        tree qualifying_scope,
                                        tree context_class)
 {
-  if (context_class && CLASS_TYPE_P (qualifying_scope) 
+  if (context_class && context_class != error_mark_node
+      && CLASS_TYPE_P (qualifying_scope)
       && DERIVED_FROM_P (qualifying_scope, context_class)
       && BASELINK_P (decl))
     {
index 2b68cad1a3db1e984c70a223dacde331958f710e..b720772ea5ac73a22b0761187197674e327afc09 100644 (file)
@@ -1,5 +1,8 @@
 2006-05-15  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR c++/27581
+       * g++.dg/lookup/this1.C: New test.
+
        PR c++/27315
        * g++.dg/template/operator6.C: New test.
        * g++.dg/template/incomplete3.C: New test.
diff --git a/gcc/testsuite/g++.dg/lookup/this1.C b/gcc/testsuite/g++.dg/lookup/this1.C
new file mode 100644 (file)
index 0000000..20051bf
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/27581
+// { dg-do compile }
+
+struct A
+{
+    template<int> static void foo();
+    static void bar() { this->A::foo<0>(); } // { dg-error "unavailable" }
+};