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