OSDN Git Service

cp/
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Oct 2006 16:07:41 +0000 (16:07 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 22 Oct 2006 16:07:41 +0000 (16:07 +0000)
PR c++/20647
* rtti.c (tinfo_base_init): The type info string is always global.
testsuite/
PR c++/20647
* g++.dg/abi/rtti3.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117957 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/rtti.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/rtti3.C [new file with mode: 0644]

index a0cfbc0..0e6314c 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-22  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/20647
+       * rtti.c (tinfo_base_init): The type info string is always global.
+
 2006-10-20  Lee Millward  <lee.millward@codesourcery.com>
             Mark Mitchell <mark@codesourcery.com>
 
index 0cb825d..077d3e0 100644 (file)
@@ -824,13 +824,7 @@ tinfo_base_init (tinfo_s *ti, tree target)
     TREE_STATIC (name_decl) = 1;
     DECL_EXTERNAL (name_decl) = 0;
     DECL_TINFO_P (name_decl) = 1;
-    if (involves_incomplete_p (target))
-      {
-       TREE_PUBLIC (name_decl) = 0;
-       DECL_INTERFACE_KNOWN (name_decl) = 1;
-      }
-    else
-      set_linkage_according_to_type (target, name_decl);
+    set_linkage_according_to_type (target, name_decl);
     import_export_decl (name_decl);
     DECL_INITIAL (name_decl) = name_string;
     mark_used (name_decl);
index b55cd7c..1d6b02b 100644 (file)
@@ -1,3 +1,8 @@
+2006-10-22  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/20647
+       * g++.dg/abi/rtti3.C: New.
+
 2006-10-21  Uros Bizjak  <uros@kss-loka.si>
 
        PR middle-end/28252
diff --git a/gcc/testsuite/g++.dg/abi/rtti3.C b/gcc/testsuite/g++.dg/abi/rtti3.C
new file mode 100644 (file)
index 0000000..4c118d1
--- /dev/null
@@ -0,0 +1,13 @@
+// PR 20647, we must emit the typeinfo's string as weak, but not the
+// necessarily the type info object
+
+// { dg-require-weak "" }
+// { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" } }
+// { dg-final { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" } }
+
+struct A;
+
+void Foo ()
+{
+  throw (A **)0;
+}