]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/13081 (forward template declarations in <complex> let inlining...
authorMatthias Klose <doko@debian.org>
Fri, 2 Jan 2004 11:15:03 +0000 (11:15 +0000)
committerMatthias Klose <doko@gcc.gnu.org>
Fri, 2 Jan 2004 11:15:03 +0000 (11:15 +0000)
2004-01-02  Matthias Klose  <doko@debian.org>

        Backport from mainline:
        2003-12-28  Mark Mitchell  <mark@codesourcery.com>

        PR c++/13081
        * decl.c (duplicate_decls): Preserve inline-ness when redeclaring
        a function template.

PR c++/13081
* g++.dg/opt/inline6.C: New test.

From-SVN: r75320

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

index de88fec7d340e0619df5cc5303a9c6d1ff8537be..bdcaa9f3188d18172e585f7ce7e4167f1eb57192 100644 (file)
@@ -1,3 +1,12 @@
+2004-01-02  Matthias Klose  <doko@debian.org>
+
+       Backport from mainline:
+       2003-12-28  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/13081
+       * decl.c (duplicate_decls): Preserve inline-ness when redeclaring
+       a function template.
+
 2003-12-20  Andrew Pinski  <pinskia@physics.uc.edu>
 
        Backport from mainline:
index 6f53cdde3bd7e02670d29bfc3a14f188c54c9792..f2b3589c64e40bd8b3aed69733ee2ec859d5db3d 100644 (file)
@@ -3744,6 +3744,14 @@ duplicate_decls (newdecl, olddecl)
            = DECL_SOURCE_LOCATION (newdecl);
        }
 
+      if (DECL_FUNCTION_TEMPLATE_P (newdecl))
+       {
+         DECL_INLINE (DECL_TEMPLATE_RESULT (olddecl)) 
+           |= DECL_INLINE (DECL_TEMPLATE_RESULT (newdecl));
+         DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (olddecl))
+           |= DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (newdecl));
+       }
+
       return 1;
     }
 
index e34dc4a4ca441b7afb5201e4e11d6f2c1306d65f..9994585c0777f382a09b1b228232031fafebe8a6 100644 (file)
@@ -1,3 +1,11 @@
+2004-01-02  Matthias Klose  <doko@debian.org>
+
+       Backport from mainline:
+       2003-12-28  Mark Mitchell  <mark@codesourcery.com>
+       PR c++/13081
+       * g++.dg/opt/inline6.C: New test.
+
 2004-01-01  Jakub Jelinek  <jakub@redhat.com>
 
        PR optimization/13521