diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2001-04-12 07:42:17 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2001-04-12 07:42:17 +0000 |
commit | bbb53468cc1f912add359fa97567f3b0b54476f8 (patch) | |
tree | 3d3f431a8ef5edcc3fa427cb28adaaf6a2ef6939 | |
parent | 571a66c6c9ca230da9b929b8c7c23b52989684b9 (diff) | |
download | gcc-bbb53468cc1f912add359fa97567f3b0b54476f8.zip gcc-bbb53468cc1f912add359fa97567f3b0b54476f8.tar.gz gcc-bbb53468cc1f912add359fa97567f3b0b54476f8.tar.bz2 |
method.c (make_thunk): Clear DECL_CLONED_FUNCTION.
cp:
* method.c (make_thunk): Clear DECL_CLONED_FUNCTION.
testsuite:
* g++.old-deja/g++.other/crash40.C: New test.
From-SVN: r41294
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/method.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/crash40.C | 19 |
4 files changed, 29 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 704c7fc..1066de1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2001-04-12 Nathan Sidwell <nathan@codesourcery.com> + + * method.c (make_thunk): Clear DECL_CLONED_FUNCTION. + 2001-04-11 Mark Mitchell <mark@codesourcery.com> * optimize.c (maybe_clone_body): Copy DECL_NUM_STMTS from the diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 2f89484..5839767 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -363,6 +363,8 @@ make_thunk (function, delta, vcall_index, generate_with_vtable_p) DECL_SAVED_FUNCTION_DATA (thunk) = NULL; DECL_DESTRUCTOR_P (thunk) = 0; DECL_CONSTRUCTOR_P (thunk) = 0; + /* And neither is it a clone. */ + DECL_CLONED_FUNCTION (thunk) = NULL_TREE; DECL_EXTERNAL (thunk) = 1; DECL_ARTIFICIAL (thunk) = 1; /* Even if this thunk is a member of a local class, we don't diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4075635..36c2e53 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-04-12 Nathan Sidwell <nathan@codesourcery.com> + + * g++.old-deja/g++.other/crash40.C: New test. + 2001-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * gcc.c-torture/execute/20010122-1.c: Fix declaration of alloca. diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash40.C b/gcc/testsuite/g++.old-deja/g++.other/crash40.C new file mode 100644 index 0000000..3af3f73 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/crash40.C @@ -0,0 +1,19 @@ +// Build don't link: +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 11 April 2001 <nathan@codesourcery.com> +// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> + +// Bug 1917. We were considering thunks to clones to be clones. and +// hence getting confused. + +struct A { virtual ~A(); }; +struct B { virtual ~B(); }; + +struct C: public A,B {}; + +template <class TYPE> +inline TYPE +sqr(const TYPE& x) { + return 1; +} +int f(const int t) { return sqr(t); } |