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
This commit is contained in:
Mark Mitchell 2003-04-22 22:53:01 +00:00 committed by Mark Mitchell
parent 6d412a7b22
commit ae2196c28e
4 changed files with 17 additions and 3 deletions

View File

@ -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 ...

View File

@ -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;

View File

@ -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.

View File

@ -0,0 +1,2 @@
template <class T> struct L { struct I {}; };
template <class T> void L<T>::I::foo() {} // { dg-error "" }