https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102283

--- Comment #2 from Giuseppe D'Angelo <dangelog at gmail dot com> ---
Hi,

Do you think that in my original testcase the call should be rejected as
ambiguous as well? (It seems "reasonable" to me, but maybe I'm missing some
niche detail about overload resolution when combined with template deduction.)


This small variation over the testcase:


struct A { };
struct B { };

template <typename T = A>
void f(T &&); // #1
void f(const B&) = delete; // #2

int main() {
  f({});
}

This now makes GCC select #2, and fail to compile because it's deleted; Clang
and MSVC still select #1. But a further, minor change:


struct A { };
struct B { };

template <typename T = int> // <-- changed this
void f(T &&); // #1
void f(const B&) = delete; // #2

int main() {
  f({});
}

makes GCC select #1...

Reply via email to