From: Paolo Carlini Date: Thu, 1 Dec 2011 09:34:43 +0000 (+0000) Subject: re PR c++/51367 (Broken diagnostic: 'pointer_type' not supported by dump_expr) X-Git-Tag: releases/gcc-4.7.0~1849 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a95888bb35e78b1c256a840d2adaf56bf8a82a1d;p=thirdparty%2Fgcc.git re PR c++/51367 (Broken diagnostic: 'pointer_type' not supported by dump_expr) /cp 2011-12-01 Paolo Carlini PR c++/51367 * pt.c (unify_inconsistency): Use either %qT or %qE depending on whether parm is a type or non-type parameter. /cp 2011-12-01 Paolo Carlini PR c++/51367 * g++.dg/template/error47.C: New. From-SVN: r181876 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 55addacfe464..998303417d25 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-12-01 Paolo Carlini + + PR c++/51367 + * pt.c (unify_inconsistency): Use either %qT or %qE depending on + whether parm is a type or non-type parameter. + 2011-11-30 Jason Merrill PR c++/51009 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 472508075776..15ef7a0caead 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5501,9 +5501,16 @@ static int unify_inconsistency (bool explain_p, tree parm, tree first, tree second) { if (explain_p) - inform (input_location, - " conflicting deductions for parameter %qE (%qE and %qE)", - parm, first, second); + { + if (TYPE_P (parm)) + inform (input_location, + " deduced conflicting types for parameter %qT (%qT and %qT)", + parm, first, second); + else + inform (input_location, + " deduced conflicting values for non-type parameter " + "%qE (%qE and %qE)", parm, first, second); + } return 1; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8e29dab0ade3..db9afc16709b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-12-01 Paolo Carlini + + PR c++/51367 + * g++.dg/template/error47.C: New. + 2011-11-30 Jason Merrill PR c++/51009 diff --git a/gcc/testsuite/g++.dg/template/error47.C b/gcc/testsuite/g++.dg/template/error47.C new file mode 100644 index 000000000000..7e360fe69a88 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/error47.C @@ -0,0 +1,9 @@ +// PR c++/51367 + +template void foo(T, T); // { dg-message "template" } + +void bar(void* p) +{ + foo(0, p); // { dg-error "no matching" } +} +// { dg-message "candidate|parameter 'T' ('int' and 'void*')" { target *-*-* } 7 }