Commit feb6efc1 by Nathan Froyd Committed by Nathan Froyd

re PR c++/45329 (When printing a list of candidate functions, explain why each…

re PR c++/45329 (When printing a list of candidate functions, explain why each function failed to match.)

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.

From-SVN: r167607
parent abccc9a9
2010-12-08 Nathan Froyd <froydnj@codesourcery.com>
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.
2010-12-08 Jason Merrill <jason@redhat.com>
PR c++/45822
......
2010-12-08 Nathan Froyd <froydnj@codesourcery.com>
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.
2010-12-08 Jason Merrill <jason@redhat.com>
PR c++/45822
......
......@@ -6,3 +6,4 @@ struct H {
};
int const& ref = H(); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
class C
{
template<typename U>
operator U(); // { dg-message "candidate" }
operator U(); // { dg-message "note" }
};
int fn (C c)
{
return C::operator float(c); // { dg-error "operator float.C" }
// { dg-message "candidate" "candidate note" { target *-*-* } 9 }
}
......@@ -5,8 +5,8 @@
#define vector __attribute__((vector_size(16)))
vector signed int vld (int a1, const vector signed int *a2) { return *a2; } /* { dg-message "vld" } */
vector signed short vld (int a1, const vector signed short *a2) { return *a2; } /* { dg-message "vld" } */
vector signed int vld (int a1, const vector signed int *a2) { return *a2; } /* { dg-message "vld|no known conversion" } */
vector signed short vld (int a1, const vector signed short *a2) { return *a2; } /* { dg-message "vld|no known conversion" } */
extern int i;
extern vector signed short vss;
......@@ -17,6 +17,7 @@ extern const vector signed short *cvssp;
void foo ()
{
vss = vld(i, vscp); /* { dg-error "no matching function for call" } */
// { dg-message "candidate" "candidate note" { target *-*-* } 19 }
vss = vld(i, vssp);
vss = vld(i, cvssp);
}
......
......@@ -14,5 +14,7 @@ int main()
{
A a;
a = B(); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 16 }
a = 1.0; // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 18 }
}
......@@ -6,4 +6,5 @@ void f(int i, ...); // { dg-message "void f" }
int main()
{
f(1,1); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
......@@ -2,12 +2,13 @@
// { dg-options -std=c++0x }
struct A {
A(A&&) = default; // { dg-message "A::A" }
A(A&&) = default; // { dg-message "A::A|no known conversion" }
};
struct B {
const A a;
B(const B&) = default;
B(B&&) = default; // { dg-error "implicitly deleted|no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 10 }
};
void g(B); // { dg-error "argument 1" }
......
......@@ -42,6 +42,7 @@ int main()
// These do not.
switch (a); // { dg-error "" }
bool b = a; // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 44 }
f(a); // { dg-error "" }
B b2 = { a }; // { dg-error "" }
a + true; // { dg-message "" }
......
......@@ -2,7 +2,7 @@
// { dg-options "-std=c++0x" }
struct A {
A(const A&, int = 0); // { dg-message "candidate" }
A(const A&, int = 0); // { dg-message "note" }
};
struct B
{
......@@ -14,4 +14,5 @@ int main()
B b;
(A(b)); // OK
(A(b,1)); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 16 }
}
......@@ -4,11 +4,12 @@
struct A
{
A(); // { dg-message "A::A" }
A(A&&); // { dg-message "A::A" }
A(); // { dg-message "A::A|candidate expects" }
A(A&&); // { dg-message "A::A|no known conversion" }
};
struct B: A // { dg-error "implicit|no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 11 }
{
};
......
......@@ -10,15 +10,17 @@ template <typename T, typename U>
inline typename tType_equal<T, U>::type
type_equal(U) { }
template<typename T> T* g( T* t ); // { dg-message "candidate" }
template<typename T> T* g( T* t ); // { dg-message "note" }
void test_g()
{
// Deduction to nullptr_t, no deduction to pointer type
//
g(nullptr); // { dg-error "no matching function for call to " }
// { dg-message "candidate" "candidate note" { target *-*-* } 19 }
type_equal<float*>(g((float*)nullptr));
decltype(nullptr) mynull = 0;
g(mynull); // { dg-error "no matching function for call to " }
// { dg-message "candidate" "candidate note" { target *-*-* } 23 }
type_equal<float*>(g((float*)mynull));
}
......@@ -11,5 +11,7 @@ nullptr_t k( nullptr_t ); /* { dg-message "note" } { dg-message "note" } */
void test_k()
{
k(0); /* { dg-error "is ambiguous" } */
// { dg-message "candidate" "candidate note" { target *-*-* } 13 }
k(__null); /* { dg-error "is ambiguous" } */
// { dg-message "candidate" "candidate note" { target *-*-* } 15 }
}
// { dg-options "-std=gnu++0x" }
template<typename, typename..., typename> void foo(); // { dg-message "candidate" }
template<typename, typename..., typename> void foo(); // { dg-message "note" }
void bar()
{
foo<int>(); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 6 }
}
// { dg-options "-std=gnu++0x" }
template<typename..., typename> void foo(); // { dg-message "candidate" }
template<typename..., typename> void foo(); // { dg-message "note" }
void bar()
{
foo<int>(); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 6 }
}
......@@ -8,4 +8,5 @@ template<typename... T> int foo(const T&) // { dg-error "not expanded with|T" }
void bar()
{
foo(0); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 10 }
}
......@@ -7,3 +7,4 @@ template <typename... T> struct A // { dg-error "candidates|A" }
};
A<int> a(0); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 9 }
......@@ -30,7 +30,7 @@ const volatile A cv_source();
// 6 at a time
one sink_6_123456( A&); // { dg-message "candidates" }
one sink_6_123456( A&); // { dg-message "one sink_6_123456|no known conversion" }
two sink_6_123456(const A&); // { dg-message "note" }
three sink_6_123456(volatile A&); // { dg-message "note" }
four sink_6_123456(const volatile A&); // { dg-message "note" }
......@@ -44,11 +44,13 @@ int test6_123456()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_123456(v_source()); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 46 }
sink_6_123456(cv_source()); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 48 }
return 0;
}
one sink_6_123457( A&); // { dg-message "candidates" }
one sink_6_123457( A&); // { dg-message "one sink_6_123457|no known conversion" }
two sink_6_123457(const A&); // { dg-message "note" }
three sink_6_123457(volatile A&); // { dg-message "note" }
four sink_6_123457(const volatile A&); // { dg-message "note" }
......@@ -62,10 +64,11 @@ int test6_123457()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_123457(cv_source()); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 66 }
return 0;
}
two sink_6_235678(const A&); // { dg-message "candidates" }
two sink_6_235678(const A&); // { dg-message "note" }
three sink_6_235678(volatile A&); // { dg-message "note" }
five sink_6_235678( A&&); // { dg-message "note" }
six sink_6_235678(const A&&); // { dg-message "note" }
......@@ -79,11 +82,12 @@ int test6_235678()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_235678(a); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 84 }
sink_6_235678(cva); // { dg-error "lvalue" }
return 0;
}
two sink_6_234678(const A&); // { dg-message "candidates" }
two sink_6_234678(const A&); // { dg-message "note" }
three sink_6_234678(volatile A&); // { dg-message "note" }
four sink_6_234678(const volatile A&); // { dg-message "note" }
six sink_6_234678(const A&&); // { dg-message "note" }
......@@ -97,11 +101,13 @@ int test6_234678()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_234678(a); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 103 }
sink_6_234678(source()); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 105 }
return 0;
}
two sink_6_234578(const A&); // { dg-message "candidates" }
two sink_6_234578(const A&); // { dg-message "note" }
three sink_6_234578(volatile A&); // { dg-message "note" }
four sink_6_234578(const volatile A&); // { dg-message "note" }
five sink_6_234578( A&&); // { dg-message "note" }
......@@ -115,10 +121,11 @@ int test6_234578()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_234578(a); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 123 }
return 0;
}
two sink_6_234568(const A&); // { dg-message "candidates" }
two sink_6_234568(const A&); // { dg-message "note" }
three sink_6_234568(volatile A&); // { dg-message "note" }
four sink_6_234568(const volatile A&); // { dg-message "note" }
five sink_6_234568( A&&); // { dg-message "note" }
......@@ -132,10 +139,11 @@ int test6_234568()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_234568(a); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 141 }
return 0;
}
two sink_6_234567(const A&); // { dg-message "candidates" }
two sink_6_234567(const A&); // { dg-message "two sink_6_234567|no known conversion" }
three sink_6_234567(volatile A&); // { dg-message "note" }
four sink_6_234567(const volatile A&); // { dg-message "note" }
five sink_6_234567( A&&); // { dg-message "note" }
......@@ -149,14 +157,16 @@ int test6_234567()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_234567(a); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 159 }
sink_6_234567(cv_source()); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 161 }
return 0;
}
one sink_6_134678( A&);
three sink_6_134678(volatile A&);
four sink_6_134678(const volatile A&);
six sink_6_134678(const A&&); // { dg-message "candidates" }
six sink_6_134678(const A&&); // { dg-message "note" }
seven sink_6_134678(volatile A&&); // { dg-message "note" }
eight sink_6_134678(const volatile A&&); // { dg-message "note" }
......@@ -167,11 +177,12 @@ int test6_134678()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_134678(source()); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 179 }
return 0;
}
one sink_6_124678( A&);
two sink_6_124678(const A&); // { dg-message "candidates" }
two sink_6_124678(const A&); // { dg-message "note" }
four sink_6_124678(const volatile A&);
six sink_6_124678(const A&&); // { dg-message "note" }
seven sink_6_124678(volatile A&&); // { dg-message "note" }
......@@ -184,11 +195,12 @@ int test6_124678()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_124678(source()); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 197 }
return 0;
}
one sink_6_123678( A&);
two sink_6_123678(const A&); // { dg-message "candidates" }
two sink_6_123678(const A&); // { dg-message "note" }
three sink_6_123678(volatile A&);
six sink_6_123678(const A&&); // { dg-message "note" }
seven sink_6_123678(volatile A&&); // { dg-message "note" }
......@@ -202,10 +214,11 @@ int test6_123678()
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_123678(cva); // { dg-error "lvalue" }
sink_6_123678(source()); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 216 }
return 0;
}
one sink_6_123567( A&); // { dg-message "candidates" }
one sink_6_123567( A&); // { dg-message "one sink_6_123567|no known conversion" }
two sink_6_123567(const A&); // { dg-message "note" }
three sink_6_123567(volatile A&); // { dg-message "note" }
five sink_6_123567( A&&); // { dg-message "note" }
......@@ -219,7 +232,9 @@ int test6_123567()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_123567(cva); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 234 }
sink_6_123567(cv_source()); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 236 }
return 0;
}
......@@ -257,7 +272,7 @@ int test6_123578()
return 0;
}
one sink_6_123467( A&); // { dg-message "candidates" }
one sink_6_123467( A&); // { dg-message "one sink_6_123467|no known conversion" }
two sink_6_123467(const A&); // { dg-message "note" }
three sink_6_123467(volatile A&); // { dg-message "note" }
four sink_6_123467(const volatile A&); // { dg-message "note" }
......@@ -271,11 +286,13 @@ int test6_123467()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_123467(source()); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 288 }
sink_6_123467(cv_source()); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 290 }
return 0;
}
one sink_6_124567( A&); // { dg-message "candidates" }
one sink_6_124567( A&); // { dg-message "one sink_6_124567|no known conversion" }
two sink_6_124567(const A&); // { dg-message "note" }
four sink_6_124567(const volatile A&); // { dg-message "note" }
five sink_6_124567( A&&); // { dg-message "note" }
......@@ -289,6 +306,7 @@ int test6_124567()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_124567(cv_source()); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 308 }
return 0;
}
......@@ -310,7 +328,7 @@ int test6_125678()
return 0;
}
one sink_6_134567( A&); // { dg-message "candidates" }
one sink_6_134567( A&); // { dg-message "one sink_6_134567|no known conversion" }
three sink_6_134567(volatile A&); // { dg-message "note" }
four sink_6_134567(const volatile A&); // { dg-message "note" }
five sink_6_134567( A&&); // { dg-message "note" }
......@@ -324,6 +342,7 @@ int test6_134567()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_6_134567(cv_source()); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 344 }
return 0;
}
......
......@@ -30,7 +30,7 @@ const volatile A cv_source();
// 7 at a time
one sink_7_1234567( A&); // { dg-message "candidates" }
one sink_7_1234567( A&); // { dg-message "one sink_7_1234567|no known conversion" }
two sink_7_1234567(const A&); // { dg-message "note" }
three sink_7_1234567(volatile A&); // { dg-message "note" }
four sink_7_1234567(const volatile A&); // { dg-message "note" }
......@@ -45,6 +45,7 @@ int test7_1234567()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_7_1234567(cv_source()); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 47 }
return 0;
}
......@@ -66,7 +67,7 @@ int test7_1235678()
return 0;
}
two sink_7_2345678(const A&); // { dg-message "candidates" }
two sink_7_2345678(const A&); // { dg-message "note" }
three sink_7_2345678(volatile A&); // { dg-message "note" }
four sink_7_2345678(const volatile A&); // { dg-message "note" }
five sink_7_2345678( A&&); // { dg-message "note" }
......@@ -81,11 +82,12 @@ int test7_2345678()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_7_2345678(a); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 84 }
return 0;
}
one sink_7_1234678( A&);
two sink_7_1234678(const A&); // { dg-message "candidates" }
two sink_7_1234678(const A&); // { dg-message "note" }
three sink_7_1234678(volatile A&);
four sink_7_1234678(const volatile A&);
six sink_7_1234678(const A&&); // { dg-message "note" }
......@@ -99,6 +101,7 @@ int test7_1234678()
volatile A va;
const volatile A cva = a; // { dg-error "lvalue" }
sink_7_1234678(source()); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 103 }
return 0;
}
......
// { dg-options "-std=c++0x" }
template <class T, class U = double>
void f(T t = 0, U u = 0); // { dg-message "candidate" }
void f(T t = 0, U u = 0); // { dg-message "note" }
void g()
{
f(1, 'c'); // f<int,char>(1,'c')
f(1); // f<int,double>(1,0)
f(); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 10 }
f<int>(); // f<int,double>(0,0)
f<int,char>(); // f<int,char>(0,0)
}
......@@ -5,7 +5,8 @@ template<class T, class U>
auto f(T,U) -> decltype(T() + U())
{ return T() + U(); }
template<class T> void g(T){} // { dg-message "candidate" }
template<class T> void g(T){} // { dg-message "note" }
int main() { g(f); } // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 10 }
// { dg-options "-std=gnu++0x" }
template<class X, class Y, class... Z> X f(Y); // { dg-message "candidate" }
template<class X, class Y, class... Z> X f(Y); // { dg-message "note" }
void g()
{
int i = f<int>(5.6);
int j = f(5.6); // { dg-error "no matching" }
f<void>(f<int, bool>);
// { dg-message "candidate" "candidate note" { target *-*-* } 6 }
f<void>(f<int, bool>);
f<void>(f<int>); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 9 }
}
// { dg-options "-std=gnu++0x" }
template<class X, class Y, class Z> X f(Y,Z); // { dg-message "candidate" }
template<class X, class Y, class Z> X f(Y,Z); // { dg-message "note" }
template<class... Args> void f2();
void g()
{
......@@ -8,5 +8,6 @@ void g()
f<int>("aa",3.0); // Y is deduced to be char*, and
// Z is deduced to be double
f("aa",3.0); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 10 }
f2<char, short, int, long>(); // okay
}
// { dg-options "-std=gnu++0x" }
template<int I, typename... Args>
void get_ith(const Args&... args); // { dg-message "candidate" }
void get_ith(const Args&... args); // { dg-message "note" }
void f()
{
get_ith<1, float>(1, 2.0, 'x');
get_ith<1, int, double, char, int>(1, 2.0, 'x'); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
// { dg-options "-std=c++0x" }
template<typename _Tp>
_Tp&& forward(_Tp&& __t) { return __t; } // { dg-message "candidate" }
_Tp&& forward(_Tp&& __t) { return __t; } // { dg-message "note" }
void f(...);
......@@ -9,6 +9,7 @@ template<typename... Args>
void g(Args&&... args)
{
f(forward<Args...>(args...)); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 11 }
}
void h()
......
// { dg-options "-std=c++0x" }
template<class U, class... T>
void f() // { dg-message "candidate" }
void f() // { dg-message "note" }
{
f<T...>(); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 6 }
}
template<>
......
......@@ -6,5 +6,7 @@ struct A { // { dg-message "A" }
void foo(volatile A a) {
1 ? a : 0; // { dg-error "match|temporary" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
1 ? 0 : a; // { dg-error "match|temporary" }
// { dg-message "candidate" "candidate note" { target *-*-* } 10 }
}
......@@ -7,7 +7,7 @@
struct A
{
void f();
void foo(void (A::*)(int)); // { dg-message "candidate" "" }
void foo(void (A::*)(int)); // { dg-message "void A::foo|no known conversion" "" }
template<typename T>
void g(T);
void h()
......@@ -15,5 +15,6 @@ struct A
void (A::*p)() = &A::f;
void (A::*q)() = &(A::f); // { dg-error "parenthesized" "" }
foo(&g<int>); // { dg-error "no matching" "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 17 }
}
};
......@@ -3,5 +3,4 @@
struct A { };
int main() { b: A() && && b; } // { dg-error "A\\(\\) && && *b" }
// { dg-message "candidate" "additional" { target *-*-* } 5 }
// { dg-message "candidate|operator&&|no known conversion" "additional" { target *-*-* } 5 }
......@@ -2,7 +2,7 @@
// { dg-do compile }
template <void (*fn) ()>
void call () // { dg-message "candidate" }
void call () // { dg-message "note" }
{
fn ();
}
......@@ -27,7 +27,9 @@ int main ()
};
call<&B1::fn1> ();
call<&B2::fn2> (); // { dg-error "not external linkage|no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 29 }
call<&fn3> ();
call<&B1::fn4> ();
call<&fn5> (); // { dg-error "not external linkage|no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 33 }
}
......@@ -8,11 +8,12 @@
// errors.
template <unsigned int N>
char* begin(char (&a) [N] ); // { dg-message "candidate" }
char* begin(char (&a) [N] ); // { dg-message "note" }
void bar(int i)
{
char d[i] ;
begin(d); // { dg-error "no matching function" "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 17 }
}
// PR c++/26690
// { dg-do compile }
struct A // { dg-message "A::A" }
struct A // { dg-message "A::A|candidate expects" }
{
A (int); // { dg-message "candidates" }
A (int); // { dg-message "note" }
};
void
......@@ -11,5 +11,6 @@ foo ()
{
A a(0);
#pragma omp parallel private (a) // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 13 }
;
}
......@@ -4,7 +4,7 @@
struct A
{
A (int x = 6); // { dg-message "A::A\\(int\\)" }
A (long long x = 12LL); // { dg-message "candidates" }
A (long long x = 12LL); // { dg-message "note" }
};
void
......@@ -12,5 +12,6 @@ foo ()
{
A a(6);
#pragma omp parallel private (a) // { dg-error "call of overloaded" }
// { dg-message "candidate" "candidate note" { target *-*-* } 14 }
;
}
......@@ -6,6 +6,7 @@ struct G {
};
class A // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
{
const G g;
};
......
......@@ -22,5 +22,6 @@ struct B : A1, A2
int Foo (B const &b)
{
return b; // { dg-error "ambiguous" "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 24 }
}
......@@ -6,8 +6,9 @@ int main() {
int i;
void* operator new(__SIZE_TYPE__ s, int* p);
int* e = new(&i) int; // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
int* f = new int;
return 0;
}
// { dg-message "candidate" "" { target *-*-* } 0 }
// { dg-message "operator new|candidate expects" "" { target *-*-* } 0 }
......@@ -4,7 +4,7 @@
// an ambiguous overload set to be created.
namespace B {
void f(int); // { dg-message "candidates" }
void f(int); // { dg-message "note" }
void f(double); // { dg-message "note" }
}
......@@ -20,6 +20,7 @@ void h()
using C::f;
f('h');
f(1); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 22 }
void f(int); // { dg-error "previous using declaration" }
}
......
......@@ -3,8 +3,10 @@
struct A // { dg-message "note" }
{
A(void x); // { dg-error "invalid use|incomplete type|candidates" }
// { dg-message "" "match candidate text" { target *-*-* } 5 }
};
struct B : A {}; // { dg-error "no matching function for call|deleted" }
// { dg-message "candidate" "candidate note" { target *-*-* } 9 }
B b; // { dg-message "synthesized method|deleted" }
// PR c++/34275
// { dg-do compile }
struct A // { dg-message "operator=" }
struct A // { dg-message "operator=|no known conversion" }
{
virtual A foo ();
};
......@@ -9,4 +9,5 @@ struct A // { dg-message "operator=" }
void bar (A& a)
{
a.foo () = 0; // { dg-error "A::foo\\(\\) = 0" }
// { dg-message "candidate" "candidate note" { target *-*-* } 11 }
}
......@@ -3,11 +3,12 @@
// { dg-options "" }
// { dg-bogus "not supported by" "" { target *-*-* } 0 }
struct A {}; // { dg-message "operator=" }
struct A {}; // { dg-message "operator=|no known conversion" }
void
foo ()
{
A a;
a = ({ { 1; } }); // { dg-error "no match for" }
// { dg-message "candidate" "candidate note" { target *-*-* } 12 }
}
......@@ -6,4 +6,5 @@ template<int> void foo(struct {}*); // { dg-message "" }
void bar()
{
foo<0>(0); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
......@@ -3,7 +3,7 @@
template <class C, void (C::*M) ()>
static
void foo(void *obj) // { dg-message "candidate" }
void foo(void *obj) // { dg-message "note" }
{
C *p = static_cast<C*>(obj);
(p->*M)();
......@@ -14,6 +14,7 @@ static void
bar(C *c, void (C::*m) ())
{
foo<C,m>((void *)c);// { dg-error "(not a valid template arg|pointer-to-member|no matching fun)" }
// { dg-message "candidate" "candidate note" { target *-*-* } 16 }
}
struct S
......
......@@ -5,7 +5,7 @@ struct A {};
template <int A::* p>
int
foo(A* q) // { dg-message "candidate" }
foo(A* q) // { dg-message "note" }
{
return q->*p;
}
......@@ -15,6 +15,7 @@ int
bar(int T::* p)
{
return foo<p>(0);// { dg-error "(not a valid template arg|no matching func|pointer-to-member)" }
// { dg-message "candidate" "candidate note" { target *-*-* } 17 }
}
int i = bar<A>(0);
......
......@@ -20,4 +20,5 @@ void f(B); // { dg-message "note" "candidate" }
int main()
{
f (42); // { dg-error "ambiguous" "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 22 }
}
......@@ -10,8 +10,8 @@ struct A {};
struct B : A
{
B(int); // { dg-message "B::B" "" }
B(B&); // { dg-message "candidates" "" }
B(int); // { dg-message "B::B|no known conversion" "" }
B(B&); // { dg-message "note" "" }
};
void foo(B); // { dg-error "initializing" }
......@@ -19,4 +19,5 @@ void foo(B); // { dg-error "initializing" }
void bar()
{
foo(0); // { dg-error "no matching function" "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 21 }
}
......@@ -13,5 +13,6 @@ int main ()
{
A a;
a + a; // { dg-error "ambiguous" "ambiguous" }
// { dg-message "candidates" "candidates" { target *-*-* } 15 }
// { dg-message "operator" "match candidate text" { target *-*-* } 15 }
// { dg-message "candidates" "candidates" { target *-*-* } 15 }
}
......@@ -17,4 +17,5 @@ B
f (B const& b)
{
return b; // { dg-error "matching" "matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 19 }
}
......@@ -16,6 +16,7 @@ void f(X *x = new X[4]); // { dg-error "" }
void f(X *x = new (3) X(6)); // { dg-error "" }
void f(X *x = new (2) X[10]); // { dg-error "" }
// { dg-message "candidate" "" { target *-*-* } 00 }
// { dg-message "candidate" "candidate note" { target *-*-* } 18 }
// { dg-message "operator new|candidate expects" "match candidate text" { target *-*-* } 00 }
void f(X *x = new X[10][5]); // { dg-error "" }
......@@ -8,14 +8,17 @@ namespace
void baz (...); // { dg-message "baz" }
}
template <int> void foo (...); // { dg-message "candidate" }
template <int> void bar (int, ...); // { dg-message "candidate" }
void baz (...); // { dg-message "candidate" }
template <int> void foo (...); // { dg-message "note" }
template <int> void bar (int, ...); // { dg-message "note" }
void baz (...); // { dg-message "note" }
void
test ()
{
foo <0> (0); // { dg-error "is ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 18 }
bar <1> (0, 1); // { dg-error "is ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 20 }
baz (0); // { dg-error "is ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 22 }
}
......@@ -2,8 +2,9 @@
void foo(void);
int foo(int);
template <typename T> void bar(T f); // { dg-message "candidate" }
template <typename T> void bar(T f); // { dg-message "note" }
void baz() {
bar(foo); // { dg-error "<unresolved overloaded function type>" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
......@@ -73,10 +73,12 @@ int main () {
exit (0);
_exit (0); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 75 }
abort ();
c1 ();
C1 (); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 80 }
c2 ();
C2 (); // one might expect an ambiguous call error here as well, but
......@@ -84,6 +86,7 @@ int main () {
c3 ();
C3 (); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 88 }
C3 (0);
C3 (0l);
}
// { dg-options "-w" }
class QString { // { dg-error "previous definition" }
QString (const QString & a); // { dg-message "candidate is" }
QString (const QString & a); // { dg-message "QString::QString|candidate expects" }
};
class QString { }; // { dg-error "redefinition" }
const QString q () {
QString z; // { dg-error "matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 10 }
int x;
return x ? QString () : QString (); // { dg-error "matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 13 }
}
// { dg-options "-fshow-column -fmessage-length=0 -ansi -pedantic-errors -Wno-long-long " }
// PR C++/17867
struct A // { dg-message "8:operator=" }
struct A // { dg-message "8:operator=|no known conversion for implicit" }
{
A(int);
};
......@@ -11,4 +11,5 @@ const A& foo();
void bar()
{
foo()=A(0); // { dg-error "12:no match for 'operator='" }
// { dg-message "candidate" "candidate note" { target *-*-* } 13 }
}
......@@ -2,10 +2,11 @@
// PR c++/21908
struct virt { virt () {} virt (int i) {} };
struct der : public virtual virt { // { dg-message "8:der::der" }
der (int i) : virt(i) {} // { dg-message "3:der::der" }
struct der : public virtual virt { // { dg-message "8:der::der|candidate expects" }
der (int i) : virt(i) {} // { dg-message "3:der::der|candidate expects" }
};
struct top : public der {
top () {} // { dg-bogus "der\\(const" }
// { dg-message "candidate" "candidate note" { target *-*-* } 9 }
};
// { dg-error "10:no matching function for call to 'der" "" { target *-*-* } 9 }
template <int I>
void f(); // { dg-message "candidate" }
void f(); // { dg-message "note" }
void g() { f<(3, 2)>(); } // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 4 }
......@@ -7,9 +7,10 @@
struct A
{
template<typename> void foo(int); // { dg-message "candidate" }
template<typename T> void bar(T t) { // { dg-message "candidate" }
template<typename> void foo(int); // { dg-message "note" }
template<typename T> void bar(T t) { // { dg-message "note" }
this->foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 12 }
template<typename T> void bad(T t) {
foo<typename T>(t); } // { dg-error "expected|parse error|no matching" }
};
......@@ -19,6 +20,7 @@ struct B
{
void bar(T t) {
A().bar<typename T>(t); } // { dg-error "expected|parse error|no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 22 }
void bad(T t) {
B<typename T>::bar(t); } // { dg-error "invalid|not a template" }
};
......
......@@ -8,4 +8,5 @@ namespace std
template<int> void foo()
{
!typeid(void); // { dg-error "!typeid\\(void\\)|candidate is" }
// { dg-message "" "match candidate text" { target *-*-* } 10 }
}
......@@ -4,7 +4,7 @@
namespace N1 {
struct X {
X(); // { dg-message "candidate" }
X(); // { dg-message "note" }
explicit X(const X&);
};
void f(X); // { dg-error "initializing" }
......@@ -12,13 +12,14 @@ namespace N1 {
{
X x;
f(x); // { dg-error "matching" "matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 14 }
}
}
namespace N2 {
template <class T>
struct X {
X(); // { dg-message "candidate" }
X(); // { dg-message "note" }
explicit X(const X&);
};
......@@ -30,6 +31,7 @@ namespace N2 {
{
X<T> x;
N2::f(x); // { dg-error "matching" "matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 33 }
}
template int foo<float>(); // { dg-message "instantiated from here" }
......
int i;
struct A
{
template <class T> operator T&() { return i; } // { dg-message "candidate" }
template <class T> operator T&() { return i; } // { dg-message "note" }
};
int main()
{
A().operator int(); // { dg-error "operator int" }
// { dg-message "candidate" "candidate note" { target *-*-* } 9 }
}
......@@ -7,8 +7,9 @@
struct A
{
A(A&); // { dg-message "note" }
template <class T> A(T); // { dg-message "candidate" }
template <class T> A(T); // { dg-message "note" }
};
A a = 0; // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 13 }
......@@ -11,7 +11,7 @@ struct coperator_stack
struct helper {};
template<class F>
void bla(F f) // { dg-message "candidate is" }
void bla(F f) // { dg-message "bla|no known conversion" }
{
}
......@@ -21,6 +21,7 @@ struct definition
definition()
{
bla(coperator_stack::push3<helper>); // { dg-error "matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 23 }
}
};
template <typename T>
void f(int, T (*)() = 0); // { dg-message "candidate" }
void f(int, T (*)() = 0); // { dg-message "note" }
void g() {
typedef int A[2];
f<A>(0); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 6 }
typedef void F();
f<F>(0); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 9 }
}
......@@ -40,9 +40,12 @@ struct foo {
bind (&bar::baikt);
bind (&barf); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 42 }
bind (&foo::barf); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 44 }
bindm (&barf); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 47 }
bindm (&foo::barf);
bindn (&barf);
......@@ -50,11 +53,15 @@ struct foo {
bindb (&barf);
bindb (&foo::barf); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 55 }
bind (&bark); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 58 }
bind (&bar::bark); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 60 }
bindm (&bark); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 63 }
bindm (&bar::bark);
bindn (&bark);
......@@ -62,6 +69,7 @@ struct foo {
bindb (&bark);
bindb (&bar::bark); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 71 }
}
};
......@@ -84,9 +92,12 @@ struct foo {
bind (&barT::baikt);
bind (&barf); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 94 }
bind (&foo::barf); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 96 }
bindm (&barf); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 99 }
bindm (&foo::barf);
bindn (&barf);
......@@ -94,11 +105,15 @@ struct foo {
bindb (&barf);
bindb (&foo::barf); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 107 }
bind (&bark); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 110 }
bind (&barT::bark); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 112 }
bindm (&bark); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 115 }
bindm (&barT::bark);
bindn (&bark);
......@@ -106,6 +121,7 @@ struct foo {
bindb (&bark);
bindb (&barT::bark); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 123 }
}
};
......
......@@ -32,8 +32,12 @@ int main()
{
A<B> a;
a.f(); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 34 }
a.g(); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 36 }
f(i); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 39 }
f(p); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 41 }
}
......@@ -26,5 +26,7 @@ struct B
int main()
{
f(1); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 28 }
B<A<int> >().f(); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 30 }
}
......@@ -26,4 +26,5 @@ int main()
{
s<int>::t y;
cout << y; // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 28 }
}
......@@ -3,11 +3,12 @@
struct A;
template<A&> void foo(); // { dg-message "candidate" }
template<A&> void foo(); // { dg-message "note" }
A a; // { dg-error "incomplete type" }
void bar()
{
foo<a>(); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 12 }
}
......@@ -13,12 +13,13 @@ int baz() { return A<0>::i; }
struct B
{
static void foo (int); // { dg-message "candidate is" }
static void foo (int); // { dg-message "B::foo|candidate expects" }
};
template <typename T> struct C
{
virtual void bar() const { T::foo(); } // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 21 }
};
C<B> c; // { dg-message "instantiated" }
// PR c++/17413
template <typename T> void foo() {} // { dg-message "candidate" }
template <typename T> void foo() {} // { dg-message "note" }
int main () {
struct S {};
foo<S> (); // { dg-error "match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 7 }
}
template <class T> struct PCVector2 // { dg-message "note" }
{
template <class T2> PCVector2(const PCVector2<T> &cv) ; // { dg-message "candidate" }
template <class T2> PCVector2(const PCVector2<T> &cv) ; // { dg-message "note" }
PCVector2<T> operator- (const PCVector2<T> &ov) const
{
return PCVector2<T>(ov.xFIELD, ov.yFIELD); // { dg-error "matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 7 }
}
T xFIELD, yFIELD;
......
extern void *operator new(__SIZE_TYPE__); // { dg-message "candidate" }
extern void *operator new(__SIZE_TYPE__); // { dg-message "note" }
template <class T >
struct C
......@@ -6,6 +6,7 @@ struct C
void f() {
int* node;
new (&node) int(0); // { dg-error "new" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
};
......
......@@ -5,5 +5,6 @@ template<operator+> void foo(); // { dg-error "before|non-function|template" }
void bar()
{
foo(); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 7 }
}
......@@ -14,4 +14,5 @@ struct A
template<int> void foo()
{
unique(A().begin); // { dg-error "no matching function" "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 16 }
}
......@@ -7,9 +7,10 @@
struct A {};
template <typename T> T A::* Foo (); // { dg-message "candidate" }
template <typename T> T A::* Foo (); // { dg-message "note" }
void Baz ()
{
Foo <int &> (); // { dg-error "no matching function" "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 14 }
}
......@@ -8,9 +8,10 @@ struct B
void foo();
};
template<void (A::*)()> void bar(); // { dg-message "candidate" }
template<void (A::*)()> void bar(); // { dg-message "note" }
void baz()
{
bar<&B::foo>(); // { dg-error "not a valid template argument|no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 15 }
}
......@@ -6,7 +6,7 @@
// Pointer to member function template argument deduction ICE.
template <class CONT> void queryAliases(CONT& fill_me); // { dg-message "candidate is" }
template <class CONT> void queryAliases(CONT& fill_me); // { dg-message "queryAliases|no known conversion" }
struct SpyExample
{
......@@ -17,4 +17,5 @@ struct SpyExample
void SpyExample::ready()
{
queryAliases(inputs); // { dg-error "matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 19 }
}
......@@ -11,7 +11,7 @@ struct B
struct D : B {};
template <int (D::*fun)() const> int Get(); // { dg-message "candidate" }
template <int (D::*fun)() const> int Get(); // { dg-message "note" }
int main ()
{
......
......@@ -4,13 +4,14 @@
template <class U> struct A
{
template <class T> class B {}; // { dg-message "operator=" }
template <class T> class B {}; // { dg-message "operator=|no known conversion" }
};
template <template <class> class TT> void f()
{
TT<int> y;
y = 0; // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 13 }
}
template <class T> struct C
......
......@@ -8,10 +8,11 @@ template<int T> struct cl {
const static int value = T;
};
template<int I> void fn (char (*) [cl<I>::value] = 0 ); // { dg-message "candidate" }
template<int I> void fn (char (*) [cl<I>::value] = 0 ); // { dg-message "note" }
void foo (void)
{
fn<0> (); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 15 }
}
......@@ -16,6 +16,6 @@ template <typename T> struct srp
};
ptr<int> parent_get()
{
srp<int> parent;
srp<int> parent; // { dg-message "candidate" }
return parent; // { dg-error "is ambiguous" }
}
......@@ -20,6 +20,7 @@ struct Bar
Foo Quux (Bar const &b)
{
return b; // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 22 }
}
......@@ -18,9 +18,12 @@ void f4(T, C<5>); // { dg-message "note" }
template<int N> struct X {};
void g() {
f1(5l, X<5>()); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 20 }
f2(X<5>(), 5);
f3(X<5>(), 5l); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 23 }
f4(5, X<5>());
f4(5l, X<5>()); // { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 26 }
f4((short)5, X<5>());
}
......@@ -6,4 +6,5 @@ template<typedef> void foo(); // { dg-error "no type|typedef declaration|templa
void bar()
{
foo<int>(); // { dg-error "matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
......@@ -12,36 +12,48 @@ struct MyClass {
};
template<class CLASS>
void mFunction(void (CLASS::* method)()) {} // { dg-message "candidate" }
void mFunction(void (CLASS::* method)()) {} // { dg-message "note" }
template<class CLASS>
void cFunction(void (CLASS::* method)() const) {} // { dg-message "candidate" }
void cFunction(void (CLASS::* method)() const) {} // { dg-message "note" }
template<class CLASS>
void vFunction(void (CLASS::* method)() volatile) {} // { dg-message "candidate" }
void vFunction(void (CLASS::* method)() volatile) {} // { dg-message "note" }
template<class CLASS>
void cvFunction(void (CLASS::* method)() const volatile) {} // { dg-message "candidate" }
void cvFunction(void (CLASS::* method)() const volatile) {} // { dg-message "note" }
int main() {
mFunction(&MyClass::mMethod);
mFunction(&MyClass::cMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 28 }
mFunction(&MyClass::vMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 30 }
mFunction(&MyClass::cvMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 32 }
cFunction(&MyClass::mMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 35 }
cFunction(&MyClass::cMethod);
cFunction(&MyClass::vMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 38 }
cFunction(&MyClass::cvMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 40 }
vFunction(&MyClass::mMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 43 }
vFunction(&MyClass::cMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 45 }
vFunction(&MyClass::vMethod);
vFunction(&MyClass::cvMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 48 }
cvFunction(&MyClass::mMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 51 }
cvFunction(&MyClass::cMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 53 }
cvFunction(&MyClass::vMethod); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 55 }
cvFunction(&MyClass::cvMethod);
return 0;
......
......@@ -8,7 +8,7 @@ struct A
template <typename S, typename T, typename U, typename S::v = &S::v::s>
typename S::A
foo (S c, T t, U u) // { dg-message "candidate" }
foo (S c, T t, U u) // { dg-message "note" }
{
}
......@@ -21,6 +21,7 @@ struct B
{
A a;
A b = foo (this, a, t); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 23 }
}
} c;
B () : c (A ())
......
......@@ -8,7 +8,7 @@ template <typename T> void Foo1 (T const *a) {a (1);} // #2
template <typename T> T const *Foo2 (T *);
template <typename T> void Foo3 (T *, T const * = 0); // { dg-message "candidate" }
template <typename T> void Foo3 (T *, T const * = 0); // { dg-message "note" }
void Bar ()
{
......@@ -19,4 +19,5 @@ void Bar ()
Foo3 (&Baz);
Foo3 (&Baz, &Baz); // { dg-error "no matching function" "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 21 }
}
......@@ -3,7 +3,7 @@
// PR c++/3518
template <typename T> void Foo (const T &);
template <typename T> void Baz (const T (*)()); // { dg-message "candidate" }
template <typename T> void Baz (const T (*)()); // { dg-message "note" }
int &f ();
......@@ -11,4 +11,5 @@ int main()
{
Foo (f);
Baz (f); // { dg-error "no matching function" "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 13 }
}
......@@ -4,7 +4,7 @@
// Origin:Wolfgang Bangerth <bangerth@dealii.org>
// PR 21799: deduction of cvqualifiers on member functions was wrong
template <class T> void f (T &, void (T::*)() ); // { dg-message "candidate" }
template <class T> void f (T &, void (T::*)() ); // { dg-message "note" }
struct X {
void g() const {}
......@@ -14,4 +14,5 @@ const X *x;
int main () {
f (*x, &X::g); // { dg-error "no matching function" }
// { dg-message "candidate" "candidate note" { target *-*-* } 16 }
}
// { dg-options "-w" }
template<typename T> void foo(T); // { dg-message "candidate" }
template<typename T> void foo(T); // { dg-message "note" }
void bar()
{
int i;
int A[i][i];
foo(A); // { dg-error "" }
// { dg-message "candidate" "candidate note" { target *-*-* } 9 }
}
......@@ -24,6 +24,7 @@ enum { first, last};
void foo(void) {
sanjose obj(first); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 26 }
}
......@@ -5,7 +5,7 @@
struct panama {
panama();
panama(panama &);
panama& operator=(panama&); // { dg-message "candidate is" }
panama& operator=(panama&); // { dg-message "operator=|no known conversion" }
};
extern panama dig();
......@@ -13,5 +13,6 @@ extern panama dig();
void foo() {
panama obj;
obj = dig(); // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 15 }
}
......@@ -8,10 +8,11 @@ struct B {
B (int);
};
void myfunc (const A& t0); // { dg-message "candidates" }
void myfunc (const A& t0); // { dg-message "note" }
void myfunc (const B& t0); // { dg-message "note" }
int main ()
{
myfunc(1); // { dg-error "ambiguous" }
// { dg-message "candidate" "candidate note" { target *-*-* } 16 }
}
......@@ -8,12 +8,13 @@ union Value
struct GlobalAddress // { dg-message "note" }
{
GlobalAddress(Value *nvar){} // { dg-message "candidates" }
GlobalAddress(Value *nvar){} // { dg-message "note" }
};
int
main()
{
new GlobalAddress(Value()); // internal error occured here// { dg-error "no matching" }
// { dg-message "candidate" "candidate note" { target *-*-* } 17 }
//new GlobalAddress(new Value()); // This line is correct code
}
// { dg-do compile }
// GROUPS passed old-abort
class internal { // { dg-message "internal::internal" }
class internal { // { dg-message "internal::internal|candidate expects|no known conversion" }
int field;
int anotherfield;
};
class bug { // { dg-message "bug::bug" }
class bug { // { dg-message "bug::bug|candidate expects" }
internal* numbers;
bug(int size);
};
bug::bug(int size) // { dg-message "bug::bug" }
bug::bug(int size) // { dg-message "bug::bug|candidate expects" }
{
numbers = new internal(size * size);// { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 15 }
}
int
main()
{
bug test; // { dg-error "no match" }
// { dg-message "candidate" "candidate note" { target *-*-* } 22 }
}
......@@ -278,6 +278,7 @@ SetLD<T>::remove(const T& item)
Vix x;
for (first(x); 0 != x && this->REMOVE_CURRENT != a; next(x, a))
a = operator()(x) == item ? this->REMOVE_CURRENT: this->NORMAL; // { dg-error "" } .*
// { dg-message "candidate" "candidate note" { target *-*-* } 280 }
}
template<class T>
bool
......@@ -286,6 +287,7 @@ SetLD<T>::contains(const T& item) const
Vix x;
for (first(x); 0 != x; next(x)) {
if (operator()(x) == item)// { dg-error "" } .*
// { dg-message "candidate" "candidate note" { target *-*-* } 289 }
return TRUE;
}
return FALSE;
......@@ -343,7 +345,7 @@ operator>=(const SetLD<T>& a, const SetLD<T>& b)
class String { };
class IcaseString: public String { };
template <> class SetLD< IcaseString >: public SetLD< String > { public: SetLD (): SetLD< String >() { }; SetLD (const ::ListD< IcaseString >& other): SetLD< String >() { ::ListD< IcaseString >::Vix x; for (other.first(x); 0 != x; other.next(x)) add(other(x)); }; SetLD (const SetLD & other): SetLD< String >(other) { }; const IcaseString & operator()(const Vix& x) const { return ( IcaseString &) SetLD< String >::operator()(x); } }; typedef SetLD< String > SetLD_String_IcaseString_old_tmp99; typedef SetLD< IcaseString > SetLD_String_IcaseString_new_tmp99;
inline int operator== (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) // { dg-message "operator==" }
inline int operator== (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) // { dg-message "operator==|no known conversion" }
{
const SetLD_String_IcaseString_old_tmp99& oa = a;
const SetLD_String_IcaseString_old_tmp99& ob = b;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment