]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (start_cleanup_fn): Clear interface_only before start_function, restore it...
authorJakub Jelinek <jakub@redhat.com>
Wed, 4 Sep 2002 08:25:52 +0000 (10:25 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 4 Sep 2002 08:25:52 +0000 (10:25 +0200)
* decl.c (start_cleanup_fn): Clear interface_only before
start_function, restore it afterwards.

* g++.dg/other/cxa-atexit1.C: New test.

From-SVN: r56789

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/cxa-atexit1.C [new file with mode: 0644]

index f21cf2a8d15ad6702f3138b037a019e7b1eb22ee..f75f91f072d47c76cdaab1f77e2380e5e7e13acf 100644 (file)
@@ -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-09-01  Alexandre Oliva  <aoliva@redhat.com>
 
        * parse.y (sizeof, alignof, typeof): New non-terminals to
index 82ec357bd9c2025c5f90cdfbde6662daac4d787d..105e7a0d0d57d4eb6c87fe3da181683d5d159339 100644 (file)
@@ -8515,6 +8515,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;
@@ -8526,6 +8527,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.  */
@@ -8567,6 +8569,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 ();
 
index 585df916285eee6250a40b1f78c57fcf4a69ccde..36a5ca380a87624725c8c0605ea88678625453ed 100644 (file)
@@ -1,3 +1,7 @@
+2002-09-04  Jakub Jelinek  <jakub@redhat.com>
+
+       * g++.dg/other/cxa-atexit1.C: New test.
+
 2002-09-01  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.dg/typeof-1.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 (file)
index 0000000..a51f334
--- /dev/null
@@ -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_" } }