re PR ipa/61659 (Extra undefined symbol because of devirtualization)
authorMarkus Trippelsdorf <markus@trippelsdorf.de>
Thu, 4 Sep 2014 12:37:05 +0000 (12:37 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 4 Sep 2014 12:37:05 +0000 (08:37 -0400)
PR ipa/61659
* decl.c (duplicate_decls): Check DECL_DECLARED_INLINE_P on
newdecl, not olddecl.

From-SVN: r214900

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/g++.dg/template/spec38.C [new file with mode: 0644]

index 258fd9bf605288d565ee52113d0307af021e8596..cce5739a86655d15130b0ad869c6000a50b4797d 100644 (file)
@@ -1,3 +1,9 @@
+2014-09-04  Markus Trippelsdorf  <markus@trippelsdorf.de>
+
+       PR ipa/61659
+       * decl.c (duplicate_decls): Check DECL_DECLARED_INLINE_P on
+       newdecl, not olddecl.
+
 2014-09-02  Paolo Carlini  <paolo.carlini@oracle.com>
 
        DR 1453
index d03f8a4707e594e6d836833c4197d1ec55e38960..d8fb35e2123742d7a25d24e4cd5c579468c8cdeb 100644 (file)
@@ -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 (file)
index 0000000..6f06f14
--- /dev/null
@@ -0,0 +1,6 @@
+// PR ipa/61659
+
+// { dg-final { scan-assembler "_Z1fIiEvPT_" } }
+
+template <typename T> inline void f (T *);
+template <> void f (int *) { }