https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66968
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- Here's another case, using the code from PR 106281: template<class A, class B> class C { public: C() = default; template<class AA, class BB> C(AA, BB) { } C(C&&) = default; private: struct __secret_tag { }; template<class AA, class BB> C(AA&, BB&, __secret_tag) { } }; C<int, int> c({}, {}); Among the overload resolution candidates we get: cons.C:8:5: note: candidate: ‘template<class AA, class BB> C<A, B>::C(AA, BB) [with BB = AA; A = int; B = int]’ Where does "with BB = AA" come from?!