diff options
author | Volker Reichelt <reichelt@igpm.rwth-aachen.de> | 2006-05-15 09:19:30 +0000 |
---|---|---|
committer | Volker Reichelt <reichelt@gcc.gnu.org> | 2006-05-15 09:19:30 +0000 |
commit | 0616700cbc830a751598dce810d82a5116d24a28 (patch) | |
tree | 2749403c7fd8e6bf57753f7ce6a6456d3fd7549c /gcc | |
parent | ad47b891c8d103457fc9e1e53b518a8d9610534b (diff) | |
download | gcc-0616700cbc830a751598dce810d82a5116d24a28.zip gcc-0616700cbc830a751598dce810d82a5116d24a28.tar.gz gcc-0616700cbc830a751598dce810d82a5116d24a28.tar.bz2 |
re PR c++/27581 (ICE using this-pointer in static member function)
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: r113781
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/search.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/this1.C | 8 |
4 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f34ea88..8443138 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 66bbb13..6622fb5 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1479,7 +1479,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)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index df08646..1dbb923 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..20051bf --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/this1.C @@ -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" } +}; |