... in any case, I can confirm that the below also passes testing. Not
sure if it makes sense to add the check also to the other call site,
can't figure out a testcase...
Thanks,
Paolo.
/////////////////
Index: cp/decl.c
===================================================================
--- cp/decl.c (revision 221317)
+++ cp/decl.c (working copy)
@@ -1922,7 +1922,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool
{
/* 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);
Index: testsuite/g++.dg/other/default11.C
===================================================================
--- testsuite/g++.dg/other/default11.C (revision 0)
+++ testsuite/g++.dg/other/default11.C (working copy)
@@ -0,0 +1,11 @@
+// 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);