diff options
| author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-04-13 18:09:57 +0000 |
|---|---|---|
| committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-04-13 18:09:57 +0000 |
| commit | f3758bbaee6d6ccae81758e0a87dc2bd6cf137e9 (patch) | |
| tree | d8df67840e22615efad5a352108e5e1281646f84 | |
| parent | 366dbbb9bf7a09de53825f1ce96c756b38413637 (diff) | |
| download | ppe42-gcc-f3758bbaee6d6ccae81758e0a87dc2bd6cf137e9.tar.gz ppe42-gcc-f3758bbaee6d6ccae81758e0a87dc2bd6cf137e9.zip | |
* decl2.c (import_export_decl): Because vtables always reference
virtual functions, even if they are inlined, don't allow
-fno-implement-inlines to not emit them, instead, emit them with
the vtable.
* decl.c (start_function): Likewise.
Fixes vtable1.C
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26416 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 3 | ||||
| -rw-r--r-- | gcc/cp/decl2.c | 6 | ||||
| -rw-r--r-- | gcc/testsuite/g++.old-deja/g++.mike/vtable1.C | 12 |
4 files changed, 26 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 179cd0c7c42..de3261256dc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +1999-04-13 Mike Stump <mrs@wrs.com> + + * decl2.c (import_export_decl): Because vtables always reference + virtual functions, even if they are inlined, don't allow + -fno-implement-inlines to not emit them, instead, emit them with + the vtable. + * decl.c (start_function): Likewise. + 1999-04-12 Jason Merrill <jason@yorick.cygnus.com> * cp-tree.h (struct lang_type): Add com_interface. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 89b136793bf..70f93d25059 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -13260,7 +13260,8 @@ start_function (declspecs, declarator, attrs, pre_parsed_p) { DECL_EXTERNAL (decl1) = (interface_only - || (DECL_THIS_INLINE (decl1) && ! flag_implement_inlines)); + || (DECL_THIS_INLINE (decl1) && ! flag_implement_inlines + && !DECL_VINDEX (decl1))); /* For WIN32 we also want to put these in linkonce sections. */ maybe_make_one_only (decl1); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 04114f74417..0ba19fdc8fa 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2773,7 +2773,8 @@ import_export_decl (decl) { DECL_NOT_REALLY_EXTERN (decl) = ! (CLASSTYPE_INTERFACE_ONLY (ctype) - || (DECL_THIS_INLINE (decl) && ! flag_implement_inlines)); + || (DECL_THIS_INLINE (decl) && ! flag_implement_inlines + && !DECL_VINDEX (decl))); /* Always make artificials weak. */ if (DECL_ARTIFICIAL (decl) && flag_weak) @@ -2803,7 +2804,8 @@ import_export_decl (decl) { DECL_NOT_REALLY_EXTERN (decl) = ! (CLASSTYPE_INTERFACE_ONLY (ctype) - || (DECL_THIS_INLINE (decl) && ! flag_implement_inlines)); + || (DECL_THIS_INLINE (decl) && ! flag_implement_inlines + && !DECL_VINDEX (decl))); /* Always make artificials weak. */ if (flag_weak) diff --git a/gcc/testsuite/g++.old-deja/g++.mike/vtable1.C b/gcc/testsuite/g++.old-deja/g++.mike/vtable1.C new file mode 100644 index 00000000000..260f93de048 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.mike/vtable1.C @@ -0,0 +1,12 @@ +// Build don't run: +// Special g++ Options: -fno-implement-inlines +struct type { + virtual void m1(); + virtual void m2() { } +}; + +void type::m1() { } + +int main() { + type t; +} |

