re PR c++/17163 (ICE with -frepo and static class variables)
authorMark Mitchell <mark@codesourcery.com>
Tue, 24 Aug 2004 06:37:58 +0000 (06:37 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Tue, 24 Aug 2004 06:37:58 +0000 (06:37 +0000)
PR c++/17163
* pt.c (instantiate_decl): Do not try to apply
DECL_DECLARED_INLINED_P to a VAR_DECL.

PR c++/17163
* g++.dg/template/repo2.C: New test.

From-SVN: r86467

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/cp/search.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/repo2.C [new file with mode: 0644]

index 1c0f95ec52119b3347224f5e722c9e791707005a..7e013c792258b6b4eedd683769e26bc9ffa9dea0 100644 (file)
@@ -1,3 +1,11 @@
+2004-08-23  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/17163
+       * pt.c (instantiate_decl): Do not try to apply
+       DECL_DECLARED_INLINED_P to a VAR_DECL.
+
+       * search.c (build_baselink): Fix typo in comment.
+
 2004-08-22 Andrew Pinski  <apinski@apple.com>
 
        Revert:
index 8ee4be9f804b415f8dddd43f97d677bfc949e0d5..b995ba41daae70ebef2d607ff40fad028a81ee9f 100644 (file)
@@ -11183,7 +11183,9 @@ instantiate_decl (tree d, int defer_ok, int undefined_ok)
       /* Instantiate inline functions so that the inliner can do its
         job, even though we'll not be emitting a copy of this
         function.  */
-      if (!flag_inline_trees || !DECL_DECLARED_INLINE_P (d))
+      if (!(TREE_CODE (d) == FUNCTION_DECL
+           && flag_inline_trees 
+           && DECL_DECLARED_INLINE_P (d)))
        goto out;
     }
 
index 459c174270519aa5acfdeb15be473791a5016dff..df5804b29ef3aa96e5faf126f7c3388020f336e1 100644 (file)
@@ -1135,7 +1135,7 @@ lookup_field_r (tree binfo, void *data)
   return NULL_TREE;
 }
 
-/* Return a "baselink" which BASELINK_BINFO, BASELINK_ACCESS_BINFO,
+/* Return a "baselink" with BASELINK_BINFO, BASELINK_ACCESS_BINFO,
    BASELINK_FUNCTIONS, and BASELINK_OPTYPE set to BINFO, ACCESS_BINFO,
    FUNCTIONS, and OPTYPE respectively.  */
 
index 38b1d24b7ebe46bbd516f0d7a48570945d81ea88..343d3bba591910101d0eacf885bf5cd07ef944c9 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-23  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/17163
+       * g++.dg/template/repo2.C: New test.
+
 2004-08-23  Roger Sayle  <roger@eyesopen.com>
 
        PR rtl-optimization/17078
diff --git a/gcc/testsuite/g++.dg/template/repo2.C b/gcc/testsuite/g++.dg/template/repo2.C
new file mode 100644 (file)
index 0000000..0fc960b
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/17163
+// { dg-options "-frepo" }
+
+template <int __inst>
+struct __Atomicity_lock
+{
+  static unsigned char _S_atomicity_lock;
+};
+template <int __inst>
+unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
+template unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
+
+int main () {
+}