OSDN Git Service

PR c++/22204
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 Jul 2005 00:25:01 +0000 (00:25 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 Jul 2005 00:25:01 +0000 (00:25 +0000)
* repo.c (repo_emit_p): Robustify.

PR c++/22204
* g++.dg/rtti/repo1.C: New test.

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

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

index e13653c..6e05977 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-15  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/22204
+       * repo.c (repo_emit_p): Robustify.
+
 2005-07-14  Daniel Berlin  <dberlin@dberlin.org>
 
        Fix PR c++/22452
index 725dbb3..b3d327d 100644 (file)
@@ -285,7 +285,8 @@ repo_emit_p (tree decl)
       else if (DECL_TINFO_P (decl))
        type = TREE_TYPE (DECL_NAME (decl));
       if (!DECL_TEMPLATE_INSTANTIATION (decl)
-         && !CLASSTYPE_TEMPLATE_INSTANTIATION (type))
+         && (!TYPE_LANG_SPECIFIC (type)
+             || !CLASSTYPE_TEMPLATE_INSTANTIATION (type)))
        return 2;
     }
   else if (!DECL_TEMPLATE_INSTANTIATION (decl))
index 61d8725..30bde12 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-15  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/22204
+       * g++.dg/rtti/repo1.C: New test.
+
 2005-07-15  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR middle-end/22398
diff --git a/gcc/testsuite/g++.dg/rtti/repo1.C b/gcc/testsuite/g++.dg/rtti/repo1.C
new file mode 100644 (file)
index 0000000..279da2b
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/22204
+// { dg-options "-frepo" }
+
+#include <typeinfo>
+template<int>
+struct function1
+{
+  function1()
+  {
+    typeid(int[100]);
+  }
+};
+function1<1> b;
+
+int main () {}