Commit cf237c19 by Jason Merrill Committed by Jason Merrill

re PR c++/9820 (ice in build_baselink (templates))

        PR c++/9820
        * search.c (lookup_member): Fix handling of functions in a class
        being defined.

From-SVN: r64193
parent ea45c4b0
2003-03-11 Jason Merrill <jason@redhat.com>
PR c++/9820
* search.c (lookup_member): Fix handling of functions in a class
being defined.
2003-03-11 Mark Mitchell <mark@codesourcery.com> 2003-03-11 Mark Mitchell <mark@codesourcery.com>
PR c++/8700 PR c++/8700
......
...@@ -1212,11 +1212,15 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type) ...@@ -1212,11 +1212,15 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type)
const char *errstr = 0; const char *errstr = 0;
/* Sanity check. */
if (TREE_CODE (name) != IDENTIFIER_NODE)
abort ();
if (xbasetype == current_class_type && TYPE_BEING_DEFINED (xbasetype) if (xbasetype == current_class_type && TYPE_BEING_DEFINED (xbasetype)
&& IDENTIFIER_CLASS_VALUE (name)) && IDENTIFIER_CLASS_VALUE (name))
{ {
tree field = IDENTIFIER_CLASS_VALUE (name); tree field = IDENTIFIER_CLASS_VALUE (name);
if (TREE_CODE (field) != FUNCTION_DECL if (! is_overloaded_fn (field)
&& ! (want_type && TREE_CODE (field) != TYPE_DECL)) && ! (want_type && TREE_CODE (field) != TYPE_DECL))
/* We're in the scope of this class, and the value has already /* We're in the scope of this class, and the value has already
been looked up. Just return the cached value. */ been looked up. Just return the cached value. */
......
// PR c++/9820
template <typename T> struct X {
template<typename> static int test(...);
template<typename> static int test(int *);
static const int i = sizeof(X<T>::template test<int>(0));
};
template class X<int>;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment