Bug 39866 - [c++0x] deleted functions not removed from "no match" error messages
Summary: [c++0x] deleted functions not removed from "no match" error messages
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.0
: P3 enhancement
Target Milestone: 4.5.0
Assignee: Jason Merrill
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-23 13:04 UTC by Sylvain Pion
Modified: 2009-10-17 15:41 UTC (History)
2 users (show)

See Also:
Host: i386-apple-darwin9.6.0
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-10-13 06:13:18


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain Pion 2009-04-23 13:04:26 UTC
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.
Comment 1 Sylvain Pion 2009-10-05 21:52:46 UTC
Problem still present as of today's trunk.
Comment 2 Paolo Carlini 2009-10-05 22:22:39 UTC
Likewise... 
Comment 3 Jason Merrill 2009-10-14 06:28:09 UTC
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

Comment 4 Jason Merrill 2009-10-17 15:41:49 UTC
Fixed for 4.5.0.