PR c++/3797
authorlerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Jul 2002 14:07:42 +0000 (14:07 +0000)
committerlerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Jul 2002 14:07:42 +0000 (14:07 +0000)
* decl.c (duplicate_decls): Don't propagate inlining parameters from
olddecl to newdecl when newdecl is a specialization of the
instantiation olddecl.

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

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

index bfa365b..6975f32 100644 (file)
@@ -1,5 +1,12 @@
 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
        * decl.c (make_typename_type): Use enforce_access.
 
index c6d77d3..f280384 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);