On 10/23/23 19:51, Patrick Palka wrote:
With the previous two patches in place, we can now extend our
deletedness diagnostic to note the other considered candidates, e.g.:
deleted16.C: In function 'int main()':
deleted16.C:10:4: error: use of deleted function 'void f(int)'
10 | f(0);
| ~^~~
deleted16.C:5:6: note: declared here
5 | void f(int) = delete;
| ^
deleted16.C:5:6: note: candidate: 'void f(int)' (deleted)
deleted16.C:6:6: note: candidate: 'void f(...)'
6 | void f(...);
| ^
deleted16.C:7:6: note: candidate: 'void f(int, int)'
7 | void f(int, int);
| ^
deleted16.C:7:6: note: candidate expects 2 arguments, 1 provided
For now, these these notes are disabled when a deleted special member
function is selected because it introduces a lot of new "cannot bind
reference" errors in the testsuite when noting non-viable candidates,
e.g. in cpp0x/initlist-opt1.C we would need to expect an error when
noting unviability of A(A&&). (It'd be nice if we could downgrade such
errors into notes when noting candidates...)
What about my suggestion to make printing the other candidates an
opt-in, with the normal output just suggesting the use of that option
for more information, like -ftemplate-backtrace-limit?
Jason