* [Bug c++/45329] When printing a list of candidate functions, explain why each function failed to match.
[not found] <bug-45329-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-17 23:02 ` bangerth at gmail dot com
2010-11-18 0:26 ` manu at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: bangerth at gmail dot com @ 2010-11-17 23:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45329
Wolfgang Bangerth <bangerth at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at gmail dot com
--- Comment #1 from Wolfgang Bangerth <bangerth at gmail dot com> 2010-11-17 23:00:20 UTC ---
I think the patch that has just been posted is awesome. My favorite reasons for
functions not matching is if you pass a const object to a non-const reference
or if there is only a non-const member function that you try to call on a const
object. In either case, assuming that a sufficient number of arguments are
involved and if they are all templates of the kind std::vector<std::vector<T>>
(with all the defaulted template arguments) it becomes essentially impossible
to see easily why the call failed.
May I make a suggestion regarding the proposed format of the error
message/note: the candidate list is currently already indented to align
candidates. Would it be possible to indent the reason why the candidate failed
*relative to the candidate*? For example something of the kind:
1 pr45329.C:26:7: error: no matching function for call to 'foo(int&)'
2 cc1plus: note: candidates are:
3 pr45329.C:7:5: note: int foo(int, int)
4 pr45329.C:7:5: candidate expects 2 arguments, 1 provided
5 pr45329.C:19:5: note: int foo(const S&)
6 pr45329.C:19:5: no known conversion for argument 1 from 'int' to 'const
S&'
(note the lack of the "note" text on lines 4,6 relative to the patch you
posted), or
1 pr45329.C:26:7: error: no matching function for call to 'foo(int&)'
2 cc1plus: note: candidates are:
3 pr45329.C:7:5: int foo(int, int)
4 pr45329.C:7:5: reason: candidate expects 2 arguments, 1 provided
5 pr45329.C:19:5: int foo(const S&)
6 pr45329.C:19:5: reason: no known conversion for argument 1 from 'int' to
'const S&'
In either case, it breaks up the long list of candidates one often gets into
self-contained blocks that are easier to parse for the human eye.
Thanks
W.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/45329] When printing a list of candidate functions, explain why each function failed to match.
[not found] <bug-45329-4@http.gcc.gnu.org/bugzilla/>
2010-11-17 23:02 ` [Bug c++/45329] When printing a list of candidate functions, explain why each function failed to match bangerth at gmail dot com
@ 2010-11-18 0:26 ` manu at gcc dot gnu.org
2010-11-18 2:45 ` bangerth at gmail dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: manu at gcc dot gnu.org @ 2010-11-18 0:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45329
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2010.11.18 00:17:00
CC| |manu at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2010-11-18 00:17:00 UTC ---
(In reply to comment #1)
> I think the patch that has just been posted is awesome.
Agreed!
> In either case, assuming that a sufficient number of arguments are
> involved and if they are all templates of the kind std::vector<std::vector<T>>
> (with all the defaulted template arguments) it becomes essentially impossible
> to see easily why the call failed.
Testcase?
> 1 pr45329.C:26:7: error: no matching function for call to 'foo(int&)'
> 2 cc1plus: note: candidates are:
> 3 pr45329.C:7:5: note: int foo(int, int)
> 4 pr45329.C:7:5: candidate expects 2 arguments, 1 provided
> 5 pr45329.C:19:5: note: int foo(const S&)
> 6 pr45329.C:19:5: no known conversion for argument 1 from 'int' to 'const
> S&'
> (note the lack of the "note" text on lines 4,6 relative to the patch you
> posted), or
I think the lack of note would be the difficult part. I don't think we have
diagnostics without prefix. And diagnostics do not accept '\n'.
Even if such diagnostic were implemented "note:" is a translated string, so the
indentation has to be relative to it.
>
> 1 pr45329.C:26:7: error: no matching function for call to 'foo(int&)'
> 2 cc1plus: note: candidates are:
> 3 pr45329.C:7:5: int foo(int, int)
> 4 pr45329.C:7:5: reason: candidate expects 2 arguments, 1 provided
> 5 pr45329.C:19:5: int foo(const S&)
> 6 pr45329.C:19:5: reason: no known conversion for argument 1 from 'int' to
> 'const S&'
>
> In either case, it breaks up the long list of candidates one often gets into
> self-contained blocks that are easier to parse for the human eye.
I don't see why removing the "notes: " adds/removes blocks, since it is the
same prefix every line. But I like the idea of using a "reason:" prefix, why
not a "candidate:" prefix also?
pr45329.C:26:7: error: no matching function for call to 'foo(int&)'
pr45329.C:7:5: note: candidate: int foo(int, int)
pr45329.C:7:5: note: reason: candidate expects 2 arguments, 1 provided
pr45329.C:19:5: note: candidate: int foo(const S&)
pr45329.C:19:5: note: reason: no known conversion for argument 1 from 'int'
But personally, I would prefer everything in the same line:
pr45329.C:26:7: error: no matching function for call to 'foo(int&)'
pr45329.C:7:5: note: candidate 'int foo(int, int)' expects 2 arguments, 1
provided
pr45329.C:19:5: note: candidate 'int foo(const S&)': no known conversion for
argument 1 from 'int'
I think also that this latest version would require fewer testsuite changes.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/45329] When printing a list of candidate functions, explain why each function failed to match.
[not found] <bug-45329-4@http.gcc.gnu.org/bugzilla/>
2010-11-17 23:02 ` [Bug c++/45329] When printing a list of candidate functions, explain why each function failed to match bangerth at gmail dot com
2010-11-18 0:26 ` manu at gcc dot gnu.org
@ 2010-11-18 2:45 ` bangerth at gmail dot com
2010-12-08 21:38 ` froydnj at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: bangerth at gmail dot com @ 2010-11-18 2:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45329
--- Comment #3 from Wolfgang Bangerth <bangerth at gmail dot com> 2010-11-18 02:42:01 UTC ---
(In reply to comment #2)
> > In either case, assuming that a sufficient number of arguments are
> > involved and if they are all templates of the kind std::vector<std::vector<T>>
> > (with all the defaulted template arguments) it becomes essentially impossible
> > to see easily why the call failed.
>
> Testcase?
....................
#include <vector>
void f(int, std::vector<int> &);
void f(char, std::vector<int> &);
void bar()
{
const std::vector<int> v;
f(2,v);
}
.....................
x.cc: In function 'void bar()':
x.cc:8:8: error: no matching function for call to 'f(int, const
std::vector<int>&)'
x.cc:2:6: note: candidates are: void f(int, std::vector<int>&)
x.cc:3:6: note: void f(char, std::vector<int>&)
Previous versions of gcc printed not just std::vector<int> but
the whole std::vector<int,std::allocator<...>> thing.
> I think the lack of note would be the difficult part. I don't think we have
> diagnostics without prefix.
Sorry, I misremembered. All lines have 'note', but only the first has
'candidates are'. Either way, the following ones are indented which I think
makes it more readable.
> Even if such diagnostic were implemented "note:" is a translated string, so the
> indentation has to be relative to it.
But is it currently? (I.e. with the "candidates are:" string that is omitted in
following lines?)
> I don't see why removing the "notes: " adds/removes blocks, since it is the
> same prefix every line. But I like the idea of using a "reason:" prefix, why
> not a "candidate:" prefix also?
I don't care how it's done but if you've stared long enough at template-laden
error messages involving half a dozen function arguments of half a dozen
candidate functions, you'd really appreciate some substructuring of the list.
> But personally, I would prefer everything in the same line:
>
> pr45329.C:26:7: error: no matching function for call to 'foo(int&)'
> pr45329.C:7:5: note: candidate 'int foo(int, int)' expects 2 arguments, 1
> provided
> pr45329.C:19:5: note: candidate 'int foo(const S&)': no known conversion for
> argument 1 from 'int'
>
> I think also that this latest version would require fewer testsuite changes.
That would work for me as well. I think the testsuite argument is mistaken,
though: the goal should be to produce quality diagnostics, not to minimize the
number of changes in the testsuite.
Best
W.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/45329] When printing a list of candidate functions, explain why each function failed to match.
[not found] <bug-45329-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2010-11-18 2:45 ` bangerth at gmail dot com
@ 2010-12-08 21:38 ` froydnj at gcc dot gnu.org
2010-12-08 21:41 ` froydnj at gcc dot gnu.org
2011-07-17 2:36 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: froydnj at gcc dot gnu.org @ 2010-12-08 21:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45329
--- Comment #4 from Nathan Froyd <froydnj at gcc dot gnu.org> 2010-12-08 21:37:54 UTC ---
Author: froydnj
Date: Wed Dec 8 21:37:51 2010
New Revision: 167607
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167607
Log:
gcc/cp/
PR c++/45329
* call.c (struct conversion): Document bad_p field.
(enum rejection_reason_code): Define.
(struct conversion_info): Define.
(struct rejection_reason): Define.
(struct z_candidate): Add `reason' field.
(add_candidate): Add `reason' parameter. Store it in CAND.
(alloc_rejection, arity_rejection, arg_conversion_rejection):
New functions.
(bad_arg_conversion_rejection): New function.
(convert_class_to_reference): Add comment.
(remaining_arguments): New function.
(add_function_candidate): Record rejection reason and pass it to
add_candidate.
(add_conv_candidate, build_builtin_candidate): Likewise.
(add_template_candidate_real): Likewise.
(print_conversion_rejection): New function.
(print_z_candidate): Print CAND->REASON if it exists. Adjust
diagnostic strings.
(print_z_candidates): Add location_t argument. Adjust calling
sequence for print_z_candidate. Print header line directly.
(build_user_type_conversion_1): Add reason for rejection to
CAND. Adjust call to print_z_candidates.
(print_error_for_call_failure): New function.
(build_new_function_call): Call it. Adjust call to
print_z_candidates.
(build_operator_new_call): Likewise.
(build_op_call): Likewise.
(build_conditional_expr): Likewise.
(build_new_op): Likewise.
(build_new_method_call): Likewise.
gcc/testsuite/
PR c++/45329
* testsuite/g++.dg/conversion/ambig1.C: Adjust.
* testsuite/g++.dg/conversion/op1.C: Adjust.
* testsuite/g++.dg/conversion/simd1.C: Adjust.
* testsuite/g++.dg/cpp0x/defaulted14.C: Adjust.
* testsuite/g++.dg/cpp0x/defaulted18.C: Adjust.
* testsuite/g++.dg/cpp0x/defaulted20.C: Adjust.
* testsuite/g++.dg/cpp0x/explicit3.C: Adjust.
* testsuite/g++.dg/cpp0x/explicit4.C: Adjust.
* testsuite/g++.dg/cpp0x/implicit4.C: Adjust.
* testsuite/g++.dg/cpp0x/nullptr15.C: Adjust.
* testsuite/g++.dg/cpp0x/nullptr19.C: Adjust.
* testsuite/g++.dg/cpp0x/pr31431-2.C: Adjust.
* testsuite/g++.dg/cpp0x/pr31431.C: Adjust.
* testsuite/g++.dg/cpp0x/pr31434.C: Adjust.
* testsuite/g++.dg/cpp0x/pr31437.C: Adjust.
* testsuite/g++.dg/cpp0x/rv2n.C: Adjust.
* testsuite/g++.dg/cpp0x/rv3n.C: Adjust.
* testsuite/g++.dg/cpp0x/rv4n.C: Adjust.
* testsuite/g++.dg/cpp0x/rv5n.C: Adjust.
* testsuite/g++.dg/cpp0x/rv6n.C: Adjust.
* testsuite/g++.dg/cpp0x/rv7n.C: Adjust.
* testsuite/g++.dg/cpp0x/temp_default2.C: Adjust.
* testsuite/g++.dg/cpp0x/trailing4.C: Adjust.
* testsuite/g++.dg/cpp0x/variadic-ex3.C: Adjust.
* testsuite/g++.dg/cpp0x/variadic-ex4.C: Adjust.
* testsuite/g++.dg/cpp0x/variadic35.C: Adjust.
* testsuite/g++.dg/cpp0x/vt-35147.C: Adjust.
* testsuite/g++.dg/cpp0x/vt-37737-2.C: Adjust.
* testsuite/g++.dg/expr/cond9.C: Adjust.
* testsuite/g++.dg/expr/pmf-1.C: Adjust.
* testsuite/g++.dg/ext/label5.C: Adjust.
* testsuite/g++.dg/ext/visibility/anon8.C: Adjust.
* testsuite/g++.dg/ext/vla2.C: Adjust.
* testsuite/g++.dg/gomp/pr26690-1.C: Adjust.
* testsuite/g++.dg/gomp/pr26690-2.C: Adjust.
* testsuite/g++.dg/init/synth2.C: Adjust.
* testsuite/g++.dg/lookup/conv-1.C: Adjust.
* testsuite/g++.dg/lookup/new1.C: Adjust.
* testsuite/g++.dg/lookup/using9.C: Adjust.
* testsuite/g++.dg/other/error13.C: Adjust.
* testsuite/g++.dg/other/error20.C: Adjust.
* testsuite/g++.dg/other/error31.C: Adjust.
* testsuite/g++.dg/other/pr28114.C: Adjust.
* testsuite/g++.dg/other/ptrmem10.C: Adjust.
* testsuite/g++.dg/other/ptrmem11.C: Adjust.
* testsuite/g++.dg/overload/ambig1.C: Adjust.
* testsuite/g++.dg/overload/arg3.C: Adjust.
* testsuite/g++.dg/overload/builtin1.C: Adjust.
* testsuite/g++.dg/overload/copy1.C: Adjust.
* testsuite/g++.dg/overload/new1.C: Adjust.
* testsuite/g++.dg/overload/template4.C: Adjust.
* testsuite/g++.dg/overload/unknown1.C: Adjust.
* testsuite/g++.dg/overload/using2.C: Adjust.
* testsuite/g++.dg/parse/crash5.C: Adjust.
* testsuite/g++.dg/parse/error19.C: Adjust.
* testsuite/g++.dg/parse/error28.C: Adjust.
* testsuite/g++.dg/parse/template7.C: Adjust.
* testsuite/g++.dg/parse/typename7.C: Adjust.
* testsuite/g++.dg/rtti/typeid6.C: Adjust.
* testsuite/g++.dg/tc1/dr152.C: Adjust.
* testsuite/g++.dg/template/conv11.C: Adjust.
* testsuite/g++.dg/template/copy1.C: Adjust.
* testsuite/g++.dg/template/crash37.C: Adjust.
* testsuite/g++.dg/template/deduce3.C: Adjust.
* testsuite/g++.dg/template/dependent-expr5.C: Adjust.
* testsuite/g++.dg/template/error38.C: Adjust.
* testsuite/g++.dg/template/error40.C: Adjust.
* testsuite/g++.dg/template/friend.C: Adjust.
* testsuite/g++.dg/template/incomplete2.C: Adjust.
* testsuite/g++.dg/template/instantiate5.C: Adjust.
* testsuite/g++.dg/template/local4.C: Adjust.
* testsuite/g++.dg/template/local6.C: Adjust.
* testsuite/g++.dg/template/new3.C: Adjust.
* testsuite/g++.dg/template/operator9.C: Adjust.
* testsuite/g++.dg/template/overload6.C: Adjust.
* testsuite/g++.dg/template/ptrmem2.C: Adjust.
* testsuite/g++.dg/template/ptrmem20.C: Adjust.
* testsuite/g++.dg/template/ptrmem4.C: Adjust.
* testsuite/g++.dg/template/ptrmem8.C: Adjust.
* testsuite/g++.dg/template/qualttp5.C: Adjust.
* testsuite/g++.dg/template/sfinae2.C: Adjust.
* testsuite/g++.dg/template/spec22.C: Adjust.
* testsuite/g++.dg/template/spec23.C: Adjust.
* testsuite/g++.dg/template/ttp25.C: Adjust.
* testsuite/g++.dg/template/typedef4.C: Adjust.
* testsuite/g++.dg/template/unify10.C: Adjust.
* testsuite/g++.dg/template/unify11.C: Adjust.
* testsuite/g++.dg/template/unify6.C: Adjust.
* testsuite/g++.dg/template/unify7.C: Adjust.
* testsuite/g++.dg/template/unify9.C: Adjust.
* testsuite/g++.dg/template/varmod1.C: Adjust.
* testsuite/g++.old-deja/g++.benjamin/15799.C: Adjust.
* testsuite/g++.old-deja/g++.benjamin/15800-1.C: Adjust.
* testsuite/g++.old-deja/g++.brendan/ambiguity1.C: Adjust.
* testsuite/g++.old-deja/g++.brendan/crash29.C: Adjust.
* testsuite/g++.old-deja/g++.brendan/crash48.C: Adjust.
* testsuite/g++.old-deja/g++.brendan/crash56.C: Adjust.
* testsuite/g++.old-deja/g++.brendan/cvt3.C: Adjust.
* testsuite/g++.old-deja/g++.brendan/overload1.C: Adjust.
* testsuite/g++.old-deja/g++.brendan/overload4.C: Adjust.
* testsuite/g++.old-deja/g++.brendan/overload9.C: Adjust.
* testsuite/g++.old-deja/g++.bugs/900127_01.C: Adjust.
* testsuite/g++.old-deja/g++.bugs/900205_04.C: Adjust.
* testsuite/g++.old-deja/g++.bugs/900330_02.C: Adjust.
* testsuite/g++.old-deja/g++.bugs/900404_03.C: Adjust.
* testsuite/g++.old-deja/g++.bugs/900514_03.C: Adjust.
* testsuite/g++.old-deja/g++.eh/ctor1.C: Adjust.
* testsuite/g++.old-deja/g++.jason/conversion11.C: Adjust.
* testsuite/g++.old-deja/g++.jason/crash3.C: Adjust.
* testsuite/g++.old-deja/g++.jason/overload16.C: Adjust.
* testsuite/g++.old-deja/g++.jason/overload28.C: Adjust.
* testsuite/g++.old-deja/g++.jason/scoping10.C: Adjust.
* testsuite/g++.old-deja/g++.jason/template30.C: Adjust.
* testsuite/g++.old-deja/g++.jason/temporary2.C: Adjust.
* testsuite/g++.old-deja/g++.law/arg1.C: Adjust.
* testsuite/g++.old-deja/g++.law/arg11.C: Adjust.
* testsuite/g++.old-deja/g++.law/arm9.C: Adjust.
* testsuite/g++.old-deja/g++.law/ctors11.C: Adjust.
* testsuite/g++.old-deja/g++.law/ctors17.C: Adjust.
* testsuite/g++.old-deja/g++.law/ctors5.C: Adjust.
* testsuite/g++.old-deja/g++.law/ctors9.C: Adjust.
* testsuite/g++.old-deja/g++.law/enum4.C: Adjust.
* testsuite/g++.old-deja/g++.law/missed-error2.C: Adjust.
* testsuite/g++.old-deja/g++.law/operators32.C: Adjust.
* testsuite/g++.old-deja/g++.law/operators9.C: Adjust.
* testsuite/g++.old-deja/g++.mike/net2.C: Adjust.
* testsuite/g++.old-deja/g++.mike/net22.C: Adjust.
* testsuite/g++.old-deja/g++.mike/p11110.C: Adjust.
* testsuite/g++.old-deja/g++.mike/p1989.C: Adjust.
* testsuite/g++.old-deja/g++.mike/p2431.C: Adjust.
* testsuite/g++.old-deja/g++.mike/p438.C: Adjust.
* testsuite/g++.old-deja/g++.mike/p807a.C: Adjust.
* testsuite/g++.old-deja/g++.mike/p9068.C: Adjust.
* testsuite/g++.old-deja/g++.niklas/t120.C: Adjust.
* testsuite/g++.old-deja/g++.niklas/t121.C: Adjust.
* testsuite/g++.old-deja/g++.niklas/t128.C: Adjust.
* testsuite/g++.old-deja/g++.ns/overload2.C: Adjust.
* testsuite/g++.old-deja/g++.ns/using12.C: Adjust.
* testsuite/g++.old-deja/g++.other/crash24.C: Adjust.
* testsuite/g++.old-deja/g++.other/expr1.C: Adjust.
* testsuite/g++.old-deja/g++.other/overload11.C: Adjust.
* testsuite/g++.old-deja/g++.other/pmf3.C: Adjust.
* testsuite/g++.old-deja/g++.other/volatile1.C: Adjust.
* testsuite/g++.old-deja/g++.pt/auto_ptr.C: Adjust.
* testsuite/g++.old-deja/g++.pt/crash28.C: Adjust.
* testsuite/g++.old-deja/g++.pt/crash60.C: Adjust.
* testsuite/g++.old-deja/g++.pt/explicit38.C: Adjust.
* testsuite/g++.old-deja/g++.pt/explicit39.C: Adjust.
* testsuite/g++.old-deja/g++.pt/explicit41.C: Adjust.
* testsuite/g++.old-deja/g++.pt/explicit67.C: Adjust.
* testsuite/g++.old-deja/g++.pt/explicit77.C: Adjust.
* testsuite/g++.old-deja/g++.pt/expr2.C: Adjust.
* testsuite/g++.old-deja/g++.pt/ptrmem10.C: Adjust.
* testsuite/g++.old-deja/g++.pt/ptrmem6.C: Adjust.
* testsuite/g++.old-deja/g++.pt/spec35.C: Adjust.
* testsuite/g++.old-deja/g++.pt/spec5.C: Adjust.
* testsuite/g++.old-deja/g++.pt/spec6.C: Adjust.
* testsuite/g++.old-deja/g++.pt/t05.C: Adjust.
* testsuite/g++.old-deja/g++.pt/t24.C: Adjust.
* testsuite/g++.old-deja/g++.pt/unify4.C: Adjust.
* testsuite/g++.old-deja/g++.pt/unify6.C: Adjust.
* testsuite/g++.old-deja/g++.pt/unify8.C: Adjust.
* testsuite/g++.old-deja/g++.robertl/eb109.C: Adjust.
* testsuite/g++.old-deja/g++.robertl/eb119.C: Adjust.
* testsuite/g++.old-deja/g++.robertl/eb131.C: Adjust.
* testsuite/g++.old-deja/g++.robertl/eb22.C: Adjust.
* testsuite/g++.old-deja/g++.robertl/eb69.C: Adjust.
* testsuite/g++.old-deja/g++.robertl/eb98.C: Adjust.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/conversion/ambig1.C
trunk/gcc/testsuite/g++.dg/conversion/op1.C
trunk/gcc/testsuite/g++.dg/conversion/simd1.C
trunk/gcc/testsuite/g++.dg/cpp0x/defaulted14.C
trunk/gcc/testsuite/g++.dg/cpp0x/defaulted18.C
trunk/gcc/testsuite/g++.dg/cpp0x/defaulted20.C
trunk/gcc/testsuite/g++.dg/cpp0x/explicit3.C
trunk/gcc/testsuite/g++.dg/cpp0x/explicit4.C
trunk/gcc/testsuite/g++.dg/cpp0x/implicit4.C
trunk/gcc/testsuite/g++.dg/cpp0x/nullptr15.C
trunk/gcc/testsuite/g++.dg/cpp0x/nullptr19.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr31431-2.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr31431.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr31434.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr31437.C
trunk/gcc/testsuite/g++.dg/cpp0x/rv2n.C
trunk/gcc/testsuite/g++.dg/cpp0x/rv3n.C
trunk/gcc/testsuite/g++.dg/cpp0x/rv4n.C
trunk/gcc/testsuite/g++.dg/cpp0x/rv5n.C
trunk/gcc/testsuite/g++.dg/cpp0x/rv6n.C
trunk/gcc/testsuite/g++.dg/cpp0x/rv7n.C
trunk/gcc/testsuite/g++.dg/cpp0x/temp_default2.C
trunk/gcc/testsuite/g++.dg/cpp0x/trailing4.C
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-ex3.C
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-ex4.C
trunk/gcc/testsuite/g++.dg/cpp0x/variadic35.C
trunk/gcc/testsuite/g++.dg/cpp0x/vt-35147.C
trunk/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C
trunk/gcc/testsuite/g++.dg/expr/cond9.C
trunk/gcc/testsuite/g++.dg/expr/pmf-1.C
trunk/gcc/testsuite/g++.dg/ext/label5.C
trunk/gcc/testsuite/g++.dg/ext/visibility/anon8.C
trunk/gcc/testsuite/g++.dg/ext/vla2.C
trunk/gcc/testsuite/g++.dg/gomp/pr26690-1.C
trunk/gcc/testsuite/g++.dg/gomp/pr26690-2.C
trunk/gcc/testsuite/g++.dg/init/synth2.C
trunk/gcc/testsuite/g++.dg/lookup/conv-1.C
trunk/gcc/testsuite/g++.dg/lookup/new1.C
trunk/gcc/testsuite/g++.dg/lookup/using9.C
trunk/gcc/testsuite/g++.dg/other/error13.C
trunk/gcc/testsuite/g++.dg/other/error20.C
trunk/gcc/testsuite/g++.dg/other/error31.C
trunk/gcc/testsuite/g++.dg/other/pr28114.C
trunk/gcc/testsuite/g++.dg/other/ptrmem10.C
trunk/gcc/testsuite/g++.dg/other/ptrmem11.C
trunk/gcc/testsuite/g++.dg/overload/ambig1.C
trunk/gcc/testsuite/g++.dg/overload/arg3.C
trunk/gcc/testsuite/g++.dg/overload/builtin1.C
trunk/gcc/testsuite/g++.dg/overload/copy1.C
trunk/gcc/testsuite/g++.dg/overload/new1.C
trunk/gcc/testsuite/g++.dg/overload/template4.C
trunk/gcc/testsuite/g++.dg/overload/unknown1.C
trunk/gcc/testsuite/g++.dg/overload/using2.C
trunk/gcc/testsuite/g++.dg/parse/crash5.C
trunk/gcc/testsuite/g++.dg/parse/error19.C
trunk/gcc/testsuite/g++.dg/parse/error28.C
trunk/gcc/testsuite/g++.dg/parse/template7.C
trunk/gcc/testsuite/g++.dg/parse/typename7.C
trunk/gcc/testsuite/g++.dg/rtti/typeid6.C
trunk/gcc/testsuite/g++.dg/tc1/dr152.C
trunk/gcc/testsuite/g++.dg/template/conv11.C
trunk/gcc/testsuite/g++.dg/template/copy1.C
trunk/gcc/testsuite/g++.dg/template/crash37.C
trunk/gcc/testsuite/g++.dg/template/deduce3.C
trunk/gcc/testsuite/g++.dg/template/dependent-expr5.C
trunk/gcc/testsuite/g++.dg/template/error38.C
trunk/gcc/testsuite/g++.dg/template/error40.C
trunk/gcc/testsuite/g++.dg/template/friend.C
trunk/gcc/testsuite/g++.dg/template/incomplete2.C
trunk/gcc/testsuite/g++.dg/template/instantiate5.C
trunk/gcc/testsuite/g++.dg/template/local4.C
trunk/gcc/testsuite/g++.dg/template/local6.C
trunk/gcc/testsuite/g++.dg/template/new3.C
trunk/gcc/testsuite/g++.dg/template/operator9.C
trunk/gcc/testsuite/g++.dg/template/overload6.C
trunk/gcc/testsuite/g++.dg/template/ptrmem2.C
trunk/gcc/testsuite/g++.dg/template/ptrmem20.C
trunk/gcc/testsuite/g++.dg/template/ptrmem4.C
trunk/gcc/testsuite/g++.dg/template/ptrmem8.C
trunk/gcc/testsuite/g++.dg/template/qualttp5.C
trunk/gcc/testsuite/g++.dg/template/sfinae2.C
trunk/gcc/testsuite/g++.dg/template/spec22.C
trunk/gcc/testsuite/g++.dg/template/spec23.C
trunk/gcc/testsuite/g++.dg/template/ttp25.C
trunk/gcc/testsuite/g++.dg/template/typedef4.C
trunk/gcc/testsuite/g++.dg/template/unify10.C
trunk/gcc/testsuite/g++.dg/template/unify11.C
trunk/gcc/testsuite/g++.dg/template/unify6.C
trunk/gcc/testsuite/g++.dg/template/unify7.C
trunk/gcc/testsuite/g++.dg/template/unify9.C
trunk/gcc/testsuite/g++.dg/template/varmod1.C
trunk/gcc/testsuite/g++.old-deja/g++.benjamin/15799.C
trunk/gcc/testsuite/g++.old-deja/g++.benjamin/15800-1.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/ambiguity1.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/crash29.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/crash48.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/cvt3.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/overload1.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/overload4.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/overload9.C
trunk/gcc/testsuite/g++.old-deja/g++.bugs/900127_01.C
trunk/gcc/testsuite/g++.old-deja/g++.bugs/900205_04.C
trunk/gcc/testsuite/g++.old-deja/g++.bugs/900330_02.C
trunk/gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C
trunk/gcc/testsuite/g++.old-deja/g++.bugs/900514_03.C
trunk/gcc/testsuite/g++.old-deja/g++.eh/ctor1.C
trunk/gcc/testsuite/g++.old-deja/g++.jason/conversion11.C
trunk/gcc/testsuite/g++.old-deja/g++.jason/crash3.C
trunk/gcc/testsuite/g++.old-deja/g++.jason/overload16.C
trunk/gcc/testsuite/g++.old-deja/g++.jason/overload28.C
trunk/gcc/testsuite/g++.old-deja/g++.jason/scoping10.C
trunk/gcc/testsuite/g++.old-deja/g++.jason/template30.C
trunk/gcc/testsuite/g++.old-deja/g++.jason/temporary2.C
trunk/gcc/testsuite/g++.old-deja/g++.law/arg1.C
trunk/gcc/testsuite/g++.old-deja/g++.law/arg11.C
trunk/gcc/testsuite/g++.old-deja/g++.law/arm9.C
trunk/gcc/testsuite/g++.old-deja/g++.law/ctors11.C
trunk/gcc/testsuite/g++.old-deja/g++.law/ctors17.C
trunk/gcc/testsuite/g++.old-deja/g++.law/ctors5.C
trunk/gcc/testsuite/g++.old-deja/g++.law/ctors9.C
trunk/gcc/testsuite/g++.old-deja/g++.law/enum4.C
trunk/gcc/testsuite/g++.old-deja/g++.law/missed-error2.C
trunk/gcc/testsuite/g++.old-deja/g++.law/operators32.C
trunk/gcc/testsuite/g++.old-deja/g++.law/operators9.C
trunk/gcc/testsuite/g++.old-deja/g++.mike/net2.C
trunk/gcc/testsuite/g++.old-deja/g++.mike/net22.C
trunk/gcc/testsuite/g++.old-deja/g++.mike/p11110.C
trunk/gcc/testsuite/g++.old-deja/g++.mike/p1989.C
trunk/gcc/testsuite/g++.old-deja/g++.mike/p2431.C
trunk/gcc/testsuite/g++.old-deja/g++.mike/p438.C
trunk/gcc/testsuite/g++.old-deja/g++.mike/p807a.C
trunk/gcc/testsuite/g++.old-deja/g++.mike/p9068.C
trunk/gcc/testsuite/g++.old-deja/g++.niklas/t120.C
trunk/gcc/testsuite/g++.old-deja/g++.niklas/t121.C
trunk/gcc/testsuite/g++.old-deja/g++.niklas/t128.C
trunk/gcc/testsuite/g++.old-deja/g++.ns/overload2.C
trunk/gcc/testsuite/g++.old-deja/g++.ns/using12.C
trunk/gcc/testsuite/g++.old-deja/g++.other/crash24.C
trunk/gcc/testsuite/g++.old-deja/g++.other/expr1.C
trunk/gcc/testsuite/g++.old-deja/g++.other/overload11.C
trunk/gcc/testsuite/g++.old-deja/g++.other/pmf3.C
trunk/gcc/testsuite/g++.old-deja/g++.other/volatile1.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/auto_ptr.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/crash28.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/crash60.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/explicit38.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/explicit39.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/explicit41.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/explicit67.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/explicit77.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/expr2.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/ptrmem10.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/spec35.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/spec5.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/spec6.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/t05.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/t24.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/unify4.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/unify6.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/unify8.C
trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb109.C
trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb119.C
trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb131.C
trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb22.C
trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb69.C
trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/45329] When printing a list of candidate functions, explain why each function failed to match.
[not found] <bug-45329-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2010-12-08 21:38 ` froydnj at gcc dot gnu.org
@ 2010-12-08 21:41 ` froydnj at gcc dot gnu.org
2011-07-17 2:36 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: froydnj at gcc dot gnu.org @ 2010-12-08 21:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45329
Nathan Froyd <froydnj at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |froydnj at gcc dot gnu.org
Resolution| |FIXED
--- Comment #5 from Nathan Froyd <froydnj at gcc dot gnu.org> 2010-12-08 21:41:32 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/45329] When printing a list of candidate functions, explain why each function failed to match.
[not found] <bug-45329-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2010-12-08 21:41 ` froydnj at gcc dot gnu.org
@ 2011-07-17 2:36 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2011-07-17 2:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45329
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-07-17 02:34:15 UTC ---
Author: jason
Date: Sun Jul 17 02:34:10 2011
New Revision: 176365
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176365
Log:
PR c++/45329
PR c++/48934
* cp-tree.h (fn_type_unification): Add `bool' parameter.
* pt.c (enum template_base_result): Define.
(unify_success, unify_unknown): Define.
(unify_parameter_deduction_failure): Define.
(unify_invalid, unify_cv_qual_mismatch, unify_type_mismatch): Define.
(unify_parameter_pack_mismatch): Define.
(unify_parameter_pack_inconsistent): Define.
(unify_ptrmem_cst_mismatch, unify_vla_arg): Define.
(unify_expression_unequal, unify_inconsistency): Define.
(unify_method_type_error, unify_arity): Likewise.
(unify_too_many_parameters, unify_too_few_parameters): Define.
(unify_arg_conversion, unify_no_common_base): Define.
(unify_illformed_ptrmem_cst_expr): Define.
(unify_substitution_failure): Define.
(unify_inconsistent_template_template_parameters): Define.
(unify_template_deduction_failure): Define.
(unify_template_argument_mismatch): Define.
(unify_overload_resolution_failure): Define.
(comp_template_args_with_info): New function, split out from...
(comp_template_args): ...here. Call it.
(deduction_tsubst_fntype): Add `complain' parameter'. Pass it
to tsubst.
(unify): Add `explain_p' parameter. Pass to all relevant calls.
Call above status functions when appropriate.
(resolve_overloaded_unification, try_one_overload): Likewise.
(type_unification, type_unification_real): Likewise.
(unify_pack_expansion): Likewise.
(get_template_base, try_class_unification): Likewise.
(get_bindings, more_specialized_fn): Pass false to unification
calls.
(get_class_bindings, do_auto_deduction): Likewise.
(convert_nontype_argument): Likewise.
(fn_type_unification): Likewise. Pass tf_warning_or_error if
explain_p.
(get_template_base): Add `explain_p' parameter and pass it to
try_class_unification. Return an enum template_base_result.
* class.c (resolve_address_of_overloaded_function): Pass false to
fn_type_unification.
* call.c (enum rejection_reason_code): Add new codes.
(struct rejection_reason): Add template_unification field.
Add template_instantiation field.
(template_unification_rejection): Define.
(template_unification_error_rejection): Define.
(template_instantiation_rejection): Define.
(invalid_copy_with_fn_template_rejection): Define.
(add_template_candidate): Pass false to unify.
Provide more rejection reasons when possible.
(print_template_unification_rejection): Define.
(print_arity_rejection): Define, split out from...
(print_z_candidate): ...here. Add cases for new rejection
reasons.
Added:
trunk/gcc/testsuite/g++.dg/overload/template5.C
trunk/gcc/testsuite/g++.dg/template/overload12.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/class.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/decltype29.C
trunk/gcc/testsuite/g++.dg/cpp0x/error4.C
trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice2.C
trunk/gcc/testsuite/g++.dg/cpp0x/nullptr15.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr31431-2.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr31431.C
trunk/gcc/testsuite/g++.dg/cpp0x/pr31434.C
trunk/gcc/testsuite/g++.dg/cpp0x/sfinae11.C
trunk/gcc/testsuite/g++.dg/cpp0x/sfinae26.C
trunk/gcc/testsuite/g++.dg/cpp0x/temp_default2.C
trunk/gcc/testsuite/g++.dg/cpp0x/trailing4.C
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-ex3.C
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-ex4.C
trunk/gcc/testsuite/g++.dg/cpp0x/variadic105.C
trunk/gcc/testsuite/g++.dg/cpp0x/vt-37737-2.C
trunk/gcc/testsuite/g++.dg/ext/vla2.C
trunk/gcc/testsuite/g++.dg/other/ptrmem10.C
trunk/gcc/testsuite/g++.dg/other/ptrmem11.C
trunk/gcc/testsuite/g++.dg/overload/unknown1.C
trunk/gcc/testsuite/g++.dg/template/conv11.C
trunk/gcc/testsuite/g++.dg/template/deduce3.C
trunk/gcc/testsuite/g++.dg/template/dependent-expr5.C
trunk/gcc/testsuite/g++.dg/template/error45.C
trunk/gcc/testsuite/g++.dg/template/friend.C
trunk/gcc/testsuite/g++.dg/template/incomplete2.C
trunk/gcc/testsuite/g++.dg/template/local4.C
trunk/gcc/testsuite/g++.dg/template/local6.C
trunk/gcc/testsuite/g++.dg/template/operator9.C
trunk/gcc/testsuite/g++.dg/template/ptrmem2.C
trunk/gcc/testsuite/g++.dg/template/sfinae2.C
trunk/gcc/testsuite/g++.dg/template/ttp25.C
trunk/gcc/testsuite/g++.dg/template/unify10.C
trunk/gcc/testsuite/g++.dg/template/unify11.C
trunk/gcc/testsuite/g++.dg/template/unify6.C
trunk/gcc/testsuite/g++.dg/template/unify7.C
trunk/gcc/testsuite/g++.dg/template/unify9.C
trunk/gcc/testsuite/g++.dg/template/varmod1.C
trunk/gcc/testsuite/g++.old-deja/g++.brendan/crash56.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/crash28.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/crash60.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/explicit41.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/explicit77.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/expr2.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/ptrmem6.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/spec5.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/spec6.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/unify4.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/unify6.C
trunk/gcc/testsuite/g++.old-deja/g++.pt/unify8.C
trunk/gcc/testsuite/g++.old-deja/g++.robertl/eb98.C
^ permalink raw reply [flat|nested] 6+ messages in thread