This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Fix bug 1917
- To: gcc-patches at gcc dot gnu dot org
- Subject: [C++ PATCH] Fix bug 1917
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Thu, 12 Apr 2001 08:48:59 +0100
- Organization: Codesourcery LLC
Hi,
I've installed this patch to fix bug 1917 on both mainline and branch.
Thunks are not clones.
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
2001-04-11 Nathan Sidwell <nathan@codesourcery.com>
* method.c (make_thunk): Clear DECL_CLONED_FUNCTION.
Index: cp/method.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/method.c,v
retrieving revision 1.190.2.8
diff -c -3 -p -r1.190.2.8 method.c
*** method.c 2001/04/11 08:43:54 1.190.2.8
--- method.c 2001/04/11 11:35:53
*************** make_thunk (function, delta, vcall_index
*** 363,368 ****
--- 363,370 ----
DECL_SAVED_FUNCTION_DATA (thunk) = NULL;
DECL_DESTRUCTOR_P (thunk) = 0;
DECL_CONSTRUCTOR_P (thunk) = 0;
+ /* And neither is it a clone. */
+ DECL_CLONED_FUNCTION (thunk) = NULL_TREE;
DECL_EXTERNAL (thunk) = 1;
DECL_ARTIFICIAL (thunk) = 1;
/* Even if this thunk is a member of a local class, we don't
// Build don't link:
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 11 April 2001 <nathan@codesourcery.com>
// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
// Bug 1917. We were considering thunks to clones to be clones. and
// hence getting confused.
struct A { virtual ~A(); };
struct B { virtual ~B(); };
struct C: public A,B {};
template <class TYPE>
inline TYPE
sqr(const TYPE& x) {
return 1;
}
int f(const int t) { return sqr(t); }