This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[C++ PATCH] Fix bugs 173, 174 & 406 (koenig lookup)


Hi,
I've installed the attached patch and testcase which fixes
bugs 173, 174 & 406 where we iced during Koenig lookup
when encountering a parameter which was `typename T::foo'. Such types
should simply be skipped.

built & tested on i686-pc-linux-gnu, approved by Mark.

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2000-08-09  Nathan Sidwell  <nathan@codesourcery.com>

	* decl2.c (arg_assoc_type): Cope with TYPENAME_TYPE.

Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.382
diff -c -3 -p -r1.382 decl2.c
*** decl2.c	2000/08/09 05:52:17	1.382
--- decl2.c	2000/08/09 13:47:42
*************** arg_assoc_type (k, type)
*** 4963,4968 ****
--- 4963,4970 ----
      case TEMPLATE_TYPE_PARM:
      case TEMPLATE_TEMPLATE_PARM:
        return 0;
+     case TYPENAME_TYPE:
+       return 0;
      case LANG_TYPE:
        if (type == unknown_type_node)
  	return 0;
// Build don't link:
// 
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 9 Aug 2000 <nathan@codesourcery.com>

// bugs 173, 174 & 406 all ICE'd due to Koenig lookup involving
// typename T::t.

struct A
{
  typedef int type;
};

template<typename T> void same_key (T, typename T::type);

template <class T> void foo (T *, void (*) (T, int));

void baz (A *ptr)
{
  foo (ptr, same_key);
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]