aboutsummaryrefslogtreecommitdiff
path: root/gcc
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
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')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/search.c11
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/parse/crash3.C2
4 files changed, 17 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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 35bbeb9..154e129e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2003-04-22 Mark Mitchell <mark@codesourcery.com>
+ PR c++/10446
+ * g++.dg/parse/crash3.C: New test.
+
PR c++/10428
* g++.dg/parse/elab1.C: New test.
diff --git a/gcc/testsuite/g++.dg/parse/crash3.C b/gcc/testsuite/g++.dg/parse/crash3.C
new file mode 100644
index 0000000..5a48ebc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash3.C
@@ -0,0 +1,2 @@
+template <class T> struct L { struct I {}; };
+template <class T> void L<T>::I::foo() {} // { dg-error "" }