diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2001-11-25 13:21:45 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2001-11-25 13:21:45 +0000 |
commit | 338d90b89f23deaa5ce2ae80b8adf9cb52808679 (patch) | |
tree | 0d461fab9e84fd53ebc0b813e9c60b27eb83f6e0 /gcc/testsuite | |
parent | 92fa4733ab20d5f4a8e9eb7c6f5c924427677549 (diff) | |
download | gcc-338d90b89f23deaa5ce2ae80b8adf9cb52808679.zip gcc-338d90b89f23deaa5ce2ae80b8adf9cb52808679.tar.gz gcc-338d90b89f23deaa5ce2ae80b8adf9cb52808679.tar.bz2 |
re PR c++/3145 (virtual inheritance still creates wrong code)
cp:
PR g++/3145
* class.c (build_vbase_pointer): Remove.
(build_vbase_path): Remove.
(build_base_path): New function.
* cp-tree.h (base_access, base_kind): New enumerations.
(build_base_path): Declare.
(convert_pointer_to_real): Remove.
(convert_pointer_to): Remove.
(lookup_base): Declare.
(convert_pointer_to_vbase): Remove.
* call.c (build_scoped_method_call): Use lookup_base &
build_base_path instead of convert_pointer_to_real,
get_base_distance & get_binfo.
(build_over_call): Likewise.
* cvt.c (cp_convert_to_pointer): Likewise.
(convert_to_pointer_force): Likewise.
(build_up_reference): Likewise.
(convert_pointer_to_real): Remove.
(convert_pointer_to): Remove.
* init.c (dfs_initialize_vtbl_ptrs): Use build_base_path
instead of convert_pointer_to_vbase & build_vbase_path.
(emit_base_init): Use build_base_path instead of
convert_pointer_to_real.
(expand_virtual_init): Lose unrequired conversions.
(resolve_offset_ref): Use lookup_base and build_base_path
instead of convert_pointer_to.
* rtti.c (build_dynamic_cast_1): Use lookup_base &
build_base_path instead of get_base_distance & build_vbase_path.
* search.c (get_vbase_1): Remove.
(get_vbase): Remove.
(convert_pointer_to_vbase): Remove.
(lookup_base_recursive): New function.
(lookup_base): New function.
* typeck.c (require_complete_type): Use lookup_base &
build_base_path instead of convert_pointer_to.
(build_component_ref): Likewise.
(build_x_function_call): Likewise.
(get_member_function_from_ptrfunc): Likewise.
(build_component_addr): Likewise.
* typeck2.c (build_scoped_ref): Likewise.
testsuite:
* g++.dg/abi/vbase8-4.C: New test.
From-SVN: r47316
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/abi/vbase8-4.C | 78 |
2 files changed, 82 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 885d091..c1a7fde 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-11-25 Nathan Sidwell <nathan@codesourcery.com> + + * g++.dg/abi/vbase8-4.C: New test. + 2001-11-24 Ian Lance Taylor <ian@airs.com> * gcc.c-torture/execute/20011121-1.c: New test. diff --git a/gcc/testsuite/g++.dg/abi/vbase8-4.C b/gcc/testsuite/g++.dg/abi/vbase8-4.C new file mode 100644 index 0000000..2e816f6 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/vbase8-4.C @@ -0,0 +1,78 @@ +// { dg-options -w } +// { dg-do run } + +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 20 Nov 2001 <nathan@codesourcery.com> + +// Origin stefan@space.twc.de +// Bug 3145 case 4. Horribly complicated class hierarchy + +class C0 +{}; +class C1 + : virtual public C0 +{}; +class C2 + : public C0 + , public C1 +{}; +class C3 + : virtual public C0 + , public C1 + , public C2 +{}; +class C4 + : public C2 + , public C3 + , virtual public C1 + , virtual public C0 +{}; +class C5 + : virtual public C2 + , public C1 + , public C0 +{}; +class C6 + : virtual public C0 + , virtual public C5 + , public C1 + , public C3 + , public C4 +{}; +class C7 + : public C6 + , virtual public C0 + , public C1 + , public C2 + , virtual public C4 +{}; +class C8 + : public C2 + , virtual public C6 + , virtual public C7 + , public C5 + , public C3 + , virtual public C4 +{}; +class C9 + : public C5 + , virtual public C3 + , virtual public C8 + , public C0 + , public C2 + , public C7 + , public C6 + , public C4 +{}; +main() { + C0 c0; + C1 c1; + C2 c2; + C3 c3; + C4 c4; + C5 c5; + C6 c6; + C7 c7; + C8 c8; + C9 c9; +} |