re PR c++/3797 (gcc 3.0 fails to emit explicit specialization of a template member)
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Wed, 17 Jul 2002 14:07:42 +0000 (14:07 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Wed, 17 Jul 2002 14:07:42 +0000 (14:07 +0000)
PR c++/3797
* decl.c (duplicate_decls): Don't propagate inlining parameters from
olddecl to newdecl when newdecl is a specialization of the
instantiation olddecl.

From-SVN: r55525

gcc/cp/ChangeLog
gcc/cp/decl.c

index bfa365bcba041c5255f8a2162c34966374292cf4..6975f32923f56c44c05ecda05e228acc03da22a2 100644 (file)
@@ -1,3 +1,10 @@
+2002-07-17  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/3797
+       * decl.c (duplicate_decls): Don't propagate inlining parameters from
+       olddecl to newdecl when newdecl is a specialization of the 
+       instantiation olddecl.
+
 2002-07-17  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
 
        PR c++/4802, c++/5387
index c6d77d3321d24af83a4f405be1e8b9b39c6d6eb8..f280384d98f14c669eba8c5001d253741607326f 100644 (file)
@@ -3366,8 +3366,6 @@ duplicate_decls (newdecl, olddecl)
        DECL_VIRTUAL_CONTEXT (newdecl) = DECL_VIRTUAL_CONTEXT (olddecl);
       if (DECL_CONTEXT (olddecl))
        DECL_CONTEXT (newdecl) = DECL_CONTEXT (olddecl);
-      if (DECL_PENDING_INLINE_INFO (newdecl) == 0)
-       DECL_PENDING_INLINE_INFO (newdecl) = DECL_PENDING_INLINE_INFO (olddecl);
       DECL_STATIC_CONSTRUCTOR (newdecl) |= DECL_STATIC_CONSTRUCTOR (olddecl);
       DECL_STATIC_DESTRUCTOR (newdecl) |= DECL_STATIC_DESTRUCTOR (olddecl);
       DECL_PURE_VIRTUAL_P (newdecl) |= DECL_PURE_VIRTUAL_P (olddecl);
@@ -3614,17 +3612,26 @@ duplicate_decls (newdecl, olddecl)
                      olddecl);
 
          SET_DECL_TEMPLATE_SPECIALIZATION (olddecl);
+
+         /* [temp.expl.spec/14] We don't inline explicit specialization
+            just because the primary template says so.  */
        }
-      DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl);
+      else
+       {
+         if (DECL_PENDING_INLINE_INFO (newdecl) == 0)
+           DECL_PENDING_INLINE_INFO (newdecl) = DECL_PENDING_INLINE_INFO (olddecl);
 
-      /* If either decl says `inline', this fn is inline, unless its
-         definition was passed already.  */
-      if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE)
-       DECL_INLINE (olddecl) = 1;
-      DECL_INLINE (newdecl) = DECL_INLINE (olddecl);
+         DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl);
 
-      DECL_UNINLINABLE (newdecl) = DECL_UNINLINABLE (olddecl)
-       = (DECL_UNINLINABLE (newdecl) || DECL_UNINLINABLE (olddecl));
+         /* If either decl says `inline', this fn is inline, unless 
+            its definition was passed already.  */
+         if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE)
+           DECL_INLINE (olddecl) = 1;
+         DECL_INLINE (newdecl) = DECL_INLINE (olddecl);
+
+         DECL_UNINLINABLE (newdecl) = DECL_UNINLINABLE (olddecl)
+           = (DECL_UNINLINABLE (newdecl) || DECL_UNINLINABLE (olddecl));
+       }
 
       /* Preserve abstractness on cloned [cd]tors.  */
       DECL_ABSTRACT (newdecl) = DECL_ABSTRACT (olddecl);