From: jason Date: Thu, 4 Sep 2014 12:37:05 +0000 (+0000) Subject: PR ipa/61659 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bb2236f633dc3acd23ecf10a4e50d26dbfd18bc;p=thirdparty%2Fgcc.git PR ipa/61659 * decl.c (duplicate_decls): Check DECL_DECLARED_INLINE_P on newdecl, not olddecl. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214900 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 258fd9bf6052..cce5739a8665 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2014-09-04 Markus Trippelsdorf + + PR ipa/61659 + * decl.c (duplicate_decls): Check DECL_DECLARED_INLINE_P on + newdecl, not olddecl. + 2014-09-02 Paolo Carlini DR 1453 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d03f8a4707e5..d8fb35e21237 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2215,7 +2215,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) olddecl); SET_DECL_TEMPLATE_SPECIALIZATION (olddecl); - DECL_COMDAT (newdecl) = DECL_DECLARED_INLINE_P (olddecl); + DECL_COMDAT (newdecl) = DECL_DECLARED_INLINE_P (newdecl); /* Don't propagate visibility from the template to the specialization here. We'll do that in determine_visibility if diff --git a/gcc/testsuite/g++.dg/template/spec38.C b/gcc/testsuite/g++.dg/template/spec38.C new file mode 100644 index 000000000000..6f06f1495847 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/spec38.C @@ -0,0 +1,6 @@ +// PR ipa/61659 + +// { dg-final { scan-assembler "_Z1fIiEvPT_" } } + +template inline void f (T *); +template <> void f (int *) { }