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 bug 611


Hi,
I've installed the attached obvious patch to fix bug 611. We ICEd after
not checking require_complete_type's return value.

built & tested on i686-pc-linux-gnu

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-11-30  Nathan Sidwell  <nathan@codesourcery.com>

	* call.c (build_over_call): Use VOID_TYPE_P. Don't die on
	incomplete return type.

Index: cp/call.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/call.c,v
retrieving revision 1.236
diff -c -3 -p -r1.236 call.c
*** call.c	2000/11/16 11:49:44	1.236
--- call.c	2000/11/30 09:02:51
*************** build_over_call (cand, args, flags)
*** 4189,4197 ****
      }
  
    fn = fold (build_call (fn, converted_args));
!   if (TREE_CODE (TREE_TYPE (fn)) == VOID_TYPE)
      return fn;
    fn = require_complete_type (fn);
    if (IS_AGGR_TYPE (TREE_TYPE (fn)))
      fn = build_cplus_new (TREE_TYPE (fn), fn);
    return convert_from_reference (fn);
--- 4189,4199 ----
      }
  
    fn = fold (build_call (fn, converted_args));
!   if (VOID_TYPE_P (TREE_TYPE (fn)))
      return fn;
    fn = require_complete_type (fn);
+   if (fn == error_mark_node)
+     return error_mark_node;
    if (IS_AGGR_TYPE (TREE_TYPE (fn)))
      fn = build_cplus_new (TREE_TYPE (fn), fn);
    return convert_from_reference (fn);
// Build don't link:

// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 28 Nov 2000 <nathan@codesourcery.com>

// Bug 611. We ICEd when calling a member function returning an incomplete
// type by value.

struct X;   // ERROR - forward ref

struct Y
{
  X foo ();
};

void baz (Y *p)
{
  p->foo ();    // ERROR - incomplete
}

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