aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-09-04 10:50:16 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2002-09-04 10:50:16 +0200
commit23ccd1f3be5147abf399cc0c09452b6635dece20 (patch)
treea4457c9b814187c23d71f350171cee587b2e158d /gcc
parent9837dc8d68ed741a2e504f9ae3b6da704ab9a3d7 (diff)
downloadgcc-23ccd1f3be5147abf399cc0c09452b6635dece20.zip
gcc-23ccd1f3be5147abf399cc0c09452b6635dece20.tar.gz
gcc-23ccd1f3be5147abf399cc0c09452b6635dece20.tar.bz2
decl.c (start_cleanup_fn): Clear interface_only before start_function, restore it afterwards.
* decl.c (start_cleanup_fn): Clear interface_only before start_function, restore it afterwards. * g++.dg/other/cxa-atexit1.C: New test. From-SVN: r56790
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c3
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.dg/other/cxa-atexit1.C26
4 files changed, 38 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 5a4ce97..c701767 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-04 Jakub Jelinek <jakub@redhat.com>
+
+ * decl.c (start_cleanup_fn): Clear interface_only before
+ start_function, restore it afterwards.
+
2002-08-31 Jason Merrill <jason@redhat.com>
* cp-lang.c (cp_expr_size): Allow initialization from a
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index bb0abbd..f3b4d87 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8445,6 +8445,7 @@ static tree
start_cleanup_fn ()
{
static int counter = 0;
+ int old_interface_only = interface_only;
int old_interface_unknown = interface_unknown;
char name[32];
tree parmtypes;
@@ -8456,6 +8457,7 @@ start_cleanup_fn ()
/* No need to mangle this. */
push_lang_context (lang_name_c);
+ interface_only = 0;
interface_unknown = 1;
/* Build the parameter-types. */
@@ -8496,6 +8498,7 @@ start_cleanup_fn ()
start_function (/*specs=*/NULL_TREE, fndecl, NULL_TREE, SF_PRE_PARSED);
interface_unknown = old_interface_unknown;
+ interface_only = old_interface_only;
pop_lang_context ();
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b1f4655..c4900bd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2002-09-04 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/other/cxa-atexit1.C: New test.
+
2002-09-03 Neil Booth <neil@daikokuya.co.uk>
* gcc.dg/cpp/_Pragma4.c: New test.
diff --git a/gcc/testsuite/g++.dg/other/cxa-atexit1.C b/gcc/testsuite/g++.dg/other/cxa-atexit1.C
new file mode 100644
index 0000000..a51f334
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/cxa-atexit1.C
@@ -0,0 +1,26 @@
+// { dg-do compile }
+// { dg-options "-O2 -fuse-cxa-atexit" }
+
+# 1 "cxa-atexit1.C"
+struct A
+{
+ struct B
+ {
+ B ();
+ ~B ();
+ };
+};
+static A::B b;
+# 1 "cxa-atexit1.h" 1
+#pragma interface
+template <class T> struct C
+{
+ ~C (void);
+};
+struct D : public C<bool>
+{
+ D (void) : C<bool> () { }
+};
+# 55 "cxa-atexit1.C" 2
+
+// { dg-final { scan-assembler-not ".gnu.linkonce.t.__tcf_" } }