The following program : ================================= struct A { A& operator=(const A&) = delete; void operator=(int) {} void operator=(char) {} }; struct B {}; int main() { A a; a = B(); // no match a = 1.0; // ambiguous } ============================== produces, with g++ -std=c++0x, current trunk version, the following two error messages : test_note_deleted_function.cpp: In function 'int main()': test_note_deleted_function.cpp:13: error: no match for 'operator=' in 'a = B()' test_note_deleted_function.cpp:2: note: candidates are: A& A::operator=(const A&) test_note_deleted_function.cpp:4: note: void A::operator=(int) test_note_deleted_function.cpp:5: note: void A::operator=(char) test_note_deleted_function.cpp:14: error: ambiguous overload for 'operator=' in 'a = 1.0e+0' test_note_deleted_function.cpp:4: note: candidates are: void A::operator=(int) test_note_deleted_function.cpp:5: note: void A::operator=(char) Note how the deleted assignment operator is listed as candidate in the "no match" error. It should probably be removed. The "ambiguous overload" case does not mention it as candidate, which I think is the right thing to do.
Problem still present as of today's trunk.
Likewise...
Subject: Bug 39866 Author: jason Date: Wed Oct 14 06:27:50 2009 New Revision: 152752 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152752 Log: PR c++/39866 * call.c (print_z_candidates): Don't print deleted candidates. (print_z_candidate): Note deleted candidates. Added: trunk/gcc/testsuite/g++.dg/cpp0x/defaulted14.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/testsuite/ChangeLog trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc
Fixed for 4.5.0.