This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH]: Fix bug 123
- To: gcc-patches at gcc dot gnu dot org
- Subject: [C++ PATCH]: Fix bug 123
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Mon, 04 Sep 2000 11:36:20 +0100
- Organization: Codesourcery LLC
Hi,
I've installed this patch for bug 123 where we find a COMPONENT_REF
inside a TEMPLATE_ID_EXPR during koenig lookup. Just process what's
being ref'd.
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-18 Nathan Sidwell <nathan@codesourcery.com>
* decl2.c (arg_assoc): Deal with COMPONENT_REFs inside
TEMPLATE_ID_EXPRs.
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.387
diff -c -3 -p -r1.387 decl2.c
*** decl2.c 2000/08/18 09:49:06 1.387
--- decl2.c 2000/08/18 11:54:05
*************** arg_assoc (k, n)
*** 5042,5047 ****
--- 5042,5050 ----
tree ctx;
tree arg;
+ if (TREE_CODE (template) == COMPONENT_REF)
+ template = TREE_OPERAND (template, 1);
+
/* First, the template. There may actually be more than one if
this is an overloaded function template. But, in that case,
we only need the first; all the functions will be in the same
// Build don't link:
//
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 18 Aug 2000 <nathan@codesourcery.com>
// bug 123. We ICEd when koenig lookup found a COMPONENT_REF inside a
// TEMPLATE_ID_EXPR.
void foo(void (*f)());
struct A {
template <int s>
static void g();
template <int s>
void f(); // ERROR - candiate
static void f_plus ()
{
foo (f<0>); // ERROR - no match
foo (g<0>);
}
};