+2015-03-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/65370
+ * decl.c (duplicate_decls): Call check_redeclaration_no_default_args
+ only if the location of newdecl doesn't match the location of olddecl.
+
2015-03-10 Jakub Jelinek <jakub@redhat.com>
PR c++/65127
{
/* Per C++11 8.3.6/4, default arguments cannot be added in later
declarations of a function template. */
- check_redeclaration_no_default_args (newdecl);
+ if (DECL_SOURCE_LOCATION (newdecl)
+ != DECL_SOURCE_LOCATION (olddecl))
+ check_redeclaration_no_default_args (newdecl);
check_default_args (newdecl);
+2015-03-10 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/65370
+ * g++.dg/other/default11.C: New.
+ * g++.dg/other/default12.C: Likewise.
+
2015-03-10 Jakub Jelinek <jakub@redhat.com>
PR target/65368
--- /dev/null
+// PR c++/65370
+
+template <typename> class C
+{
+ template <typename U>
+ C(const C<U>&, bool = false);
+};
+
+template <>
+template <typename U>
+C<int>::C(const C<U>&, bool);
--- /dev/null
+// PR c++/65370
+
+template <typename> class C
+{
+ template <typename U>
+ C(const C<U>&, bool = false);
+};
+
+template<>
+class C<int>
+{
+ template <typename U>
+ C(const C<U>&, bool);
+};
+
+template <typename U> C<int>::C(const C<U>&, bool = false) { } // { dg-error "default arguments" }