diff options
| author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-30 09:36:29 +0000 |
|---|---|---|
| committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-11-30 09:36:29 +0000 |
| commit | a91e34df091f3ccdcd0b3ba13cb7a435fc2e26ac (patch) | |
| tree | 77a0df71d9a4d8a168c292158be11c4ee6650d0c | |
| parent | 4b04d85d55c4289ddffcfe07cf63f1142a4d9c9f (diff) | |
| download | ppe42-gcc-a91e34df091f3ccdcd0b3ba13cb7a435fc2e26ac.tar.gz ppe42-gcc-a91e34df091f3ccdcd0b3ba13cb7a435fc2e26ac.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37872 138bc75d-0d04-0410-961f-82ee72b054a4
| -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 e0c75484634..32b01515b22 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 447835f1380..ecd3d22347e 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 e0f6569eb44..90c92c91f78 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 00000000000..5faab45b570 --- /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 +} |

