call.c (build_over_call): Use VOID_TYPE_P.
authorNathan Sidwell <nathan@codesourcery.com>
Thu, 30 Nov 2000 09:36:29 +0000 (09:36 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 30 Nov 2000 09:36:29 +0000 (09:36 +0000)
cp:
* call.c (build_over_call): Use VOID_TYPE_P. Don't die on
incomplete return type.
testsuite:
* g++.old-deja/g++.other/crash38.C: New test.

From-SVN: r37872

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/crash38.C [new file with mode: 0644]

index e0c75484634f9da28b8765de390ef2a8eb781305..32b01515b229412e8e5bd43b9dfd02a23215aef4 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-30  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * call.c (build_over_call): Use VOID_TYPE_P. Don't die on
+       incomplete return type.
+
 2000-11-28  Nathan Sidwell  <nathan@codesourcery.com>
 
        * parse.y (base_class.1): Produce a _TYPE not a _DECL.
index 447835f138085122ff422793b5f088b214143272..ecd3d22347e90717d045e65a9cb8429e172e90e6 100644 (file)
@@ -4189,9 +4189,11 @@ build_over_call (cand, args, flags)
     }
 
   fn = fold (build_call (fn, converted_args));
-  if (TREE_CODE (TREE_TYPE (fn)) == VOID_TYPE)
+  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);
index e0f6569eb444136d9951141579e5c61bab729ae7..90c92c91f784a933e0e5f746d4afc96887122bf5 100644 (file)
@@ -1,3 +1,7 @@
+2000-11-30  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * g++.old-deja/g++.other/crash38.C: New test.
+
 2000-11-29  Toon Moene  <toon@moene.indiv.nluug.nl>
 
        * g77.f-torture/execute/20001111.x: Test fixed - remove XFAIL.
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash38.C b/gcc/testsuite/g++.old-deja/g++.other/crash38.C
new file mode 100644 (file)
index 0000000..5faab45
--- /dev/null
@@ -0,0 +1,19 @@
+// 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
+}