aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2003-04-22 22:53:01 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2003-04-22 22:53:01 +0000
commitae2196c28e9fe2cd9291f4d8e7a040da04a72085 (patch)
tree4646e2c6e9d96025fb69c78a0bbc8edb8707d80f /gcc/cp
parent6d412a7b22b7766437e2c018f31d49aa981800d9 (diff)
downloadgcc-ae2196c28e9fe2cd9291f4d8e7a040da04a72085.zip
gcc-ae2196c28e9fe2cd9291f4d8e7a040da04a72085.tar.gz
gcc-ae2196c28e9fe2cd9291f4d8e7a040da04a72085.tar.bz2
re PR c++/10446 (ICE on a definition of a nonexistent member function of a nested class in a class template)
PR c++/10446 * search.c (lookup_fnfields_1): Handle empty slots in the method vector. PR c++/10446 * g++.dg/parse/crash3.C: New test. From-SVN: r65962
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/search.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ec4684d..c768b4f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2003-04-22 Mark Mitchell <mark@codesourcery.com>
+ PR c++/10446
+ * search.c (lookup_fnfields_1): Handle empty slots in the method
+ vector.
+
PR c++/10428
* decl.c (check_elaborated_type_specifier): New function, split
out from ...
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 433e1ac..b557fdf 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1400,9 +1400,14 @@ lookup_fnfields_1 (tree type, tree name)
n_outer_fields_searched++;
#endif /* GATHER_STATISTICS */
- tmp = DECL_NAME (OVL_CURRENT (methods[i]));
-
- if (tmp > name)
+ tmp = methods[i];
+ /* This slot may be empty; we allocate more slots
+ than we need. In that case, the entry we're
+ looking for is closer to the beginning of the
+ list. */
+ if (tmp)
+ tmp = DECL_NAME (OVL_CURRENT (tmp));
+ if (!tmp || tmp > name)
hi = i;
else if (tmp < name)
lo = i + 1;