diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-11-30 09:36:29 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-11-30 09:36:29 +0000 |
commit | 2c92b94d0f1c7c54182770327784e8cb84e65b95 (patch) | |
tree | 77a0df71d9a4d8a168c292158be11c4ee6650d0c | |
parent | 47f18b4f1352369e26f885f51605c3d824d3dbee (diff) | |
download | gcc-2c92b94d0f1c7c54182770327784e8cb84e65b95.zip gcc-2c92b94d0f1c7c54182770327784e8cb84e65b95.tar.gz gcc-2c92b94d0f1c7c54182770327784e8cb84e65b95.tar.bz2 |
call.c (build_over_call): Use VOID_TYPE_P.
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
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/call.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/crash38.C | 19 |
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e0c7548..32b0151 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 447835f..ecd3d22 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e0f6569..90c92c9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..5faab45 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/crash38.C @@ -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 +} |