From e5f900f2a671c1fb7cd61272e233a804f254de0a Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Fri, 2 Jan 2004 11:15:03 +0000 Subject: [PATCH] backport: re PR c++/13081 (forward template declarations in let inlining fail) 2004-01-02 Matthias Klose Backport from mainline: 2003-12-28 Mark Mitchell 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 | 9 +++++++++ gcc/cp/decl.c | 8 ++++++++ gcc/testsuite/ChangeLog | 8 ++++++++ 3 files changed, 25 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index de88fec7d340..bdcaa9f3188d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2004-01-02 Matthias Klose + + Backport from mainline: + 2003-12-28 Mark Mitchell + + PR c++/13081 + * decl.c (duplicate_decls): Preserve inline-ness when redeclaring + a function template. + 2003-12-20 Andrew Pinski Backport from mainline: diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 6f53cdde3bd7..f2b3589c64e4 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e34dc4a4ca44..9994585c0777 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2004-01-02 Matthias Klose + + Backport from mainline: + 2003-12-28 Mark Mitchell + + PR c++/13081 + * g++.dg/opt/inline6.C: New test. + 2004-01-01 Jakub Jelinek PR optimization/13521 -- 2.47.2