+2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/15867
+ * decl.c (duplicate_decls): With -Wredundant-decls don't warn for
+ declaration followed by specialization.
+
2012-01-03 Jakub Jelinek <jakub@redhat.com>
PR c++/51669
/* Don't warn about extern decl followed by definition. */
&& !(DECL_EXTERNAL (olddecl) && ! DECL_EXTERNAL (newdecl))
/* Don't warn about friends, let add_friend take care of it. */
- && ! (newdecl_is_friend || DECL_FRIEND_P (olddecl)))
+ && ! (newdecl_is_friend || DECL_FRIEND_P (olddecl))
+ /* Don't warn about declaration followed by specialization. */
+ && (! DECL_TEMPLATE_SPECIALIZATION (newdecl)
+ || DECL_TEMPLATE_SPECIALIZATION (olddecl)))
{
warning (OPT_Wredundant_decls, "redundant redeclaration of %qD in same scope", newdecl);
warning (OPT_Wredundant_decls, "previous declaration of %q+D", olddecl);
+2012-01-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/15867
+ * g++.dg/warn/Wredundant-decls-spec.C: New.
+
2012-01-03 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/51719
--- /dev/null
+// PR c++/15867
+// { dg-options -Wredundant-decls }
+
+template <typename T> struct S
+{
+ void foo() {}
+};
+
+template<> void S<int>::foo();
+
+template<> void S<double>::foo(); // { dg-warning "previous declaration" }
+template<> void S<double>::foo(); // { dg-warning "redundant redeclaration" }