This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ patch] Fix 4476
- To: gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Subject: [C++ patch] Fix 4476
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Wed, 10 Oct 2001 09:31:04 +0100
- Organization: Codesourcery LLC
Hi,
this fixes a recent regression I introduced removing NONCOPIED_PARTS.
I moved CLASSTYPE_INLINE_FRIENDS from there to somewhere else, which
turned out not to be quite safe enough.
built & tested on i686-pc-linux-gnu, ok?
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-10-10 Nathan Sidwell <nathan@codesourcery.com>
* typeck2.c (abstract_virtuals_error): Ignore incomplete classes.
Index: cp/typeck2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck2.c,v
retrieving revision 1.103
diff -c -3 -p -r1.103 typeck2.c
*** typeck2.c 2001/08/19 18:35:05 1.103
--- typeck2.c 2001/10/10 08:21:14
*************** abstract_virtuals_error (decl, type)
*** 140,145 ****
--- 140,150 ----
if (!CLASS_TYPE_P (type) || !CLASSTYPE_PURE_VIRTUALS (type))
return 0;
+ if (!TYPE_SIZE (type))
+ /* TYPE is being defined, and during that time
+ CLASSTYPE_PURE_VIRTUALS holds the inline friends. */
+ return 0;
+
u = CLASSTYPE_PURE_VIRTUALS (type);
if (decl)
{
// { dg-do compile }
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 10 Oct 2001 <nathan@codesourcery.com>
// Bug 4476. We tangled up inline friends and pure virtuals during
// class definition.
struct A {
friend void f () { }
void g (A a) { }
};