diff options
author | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-13 20:06:26 +0000 |
---|---|---|
committer | dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-13 20:06:26 +0000 |
commit | 2b33fa21a6c7b2517e048796f910ddfa1cab7c50 (patch) | |
tree | 31116fc0e3472ae6d75eb188178fc8614fbf05db /gcc/cp/error.c | |
parent | f5a15437493a9a32081228576995d5e6aae0cd0c (diff) | |
download | gcc-2b33fa21a6c7b2517e048796f910ddfa1cab7c50.tar.gz |
Fix PR c++/42634
gcc/cp/ChangeLog:
PR c++/42634
* error.c (dump_template_parms): Use innermost template
arguments before calling count_non_default_template_args.
(count_non_default_template_args): We are being called with
template innermost arguments now. There is no need to ensure
that again.
gcc/testsuite/ChangeLog:
PR c++/42634
* g++.dg/template/error45.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155868 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index e0e5ae52ceb..54e96810f9b 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -165,8 +165,7 @@ dump_template_argument (tree arg, int flags) static int count_non_default_template_args (tree args, tree params, int flags) { - tree inner_args = INNERMOST_TEMPLATE_ARGS (args); - int n = TREE_VEC_LENGTH (inner_args); + int n = TREE_VEC_LENGTH (args); int last; if (params == NULL_TREE @@ -195,7 +194,7 @@ count_non_default_template_args (tree args, tree params, int flags) NULL_TREE, false, true); --processing_template_decl; } - if (!cp_tree_equal (TREE_VEC_ELT (inner_args, last), def)) + if (!cp_tree_equal (TREE_VEC_ELT (args, last), def)) break; } @@ -1492,9 +1491,9 @@ dump_template_parms (tree info, int primary, int flags) ? DECL_INNERMOST_TEMPLATE_PARMS (TI_TEMPLATE (info)) : NULL_TREE); + args = INNERMOST_TEMPLATE_ARGS (args); len = count_non_default_template_args (args, params, flags); - args = INNERMOST_TEMPLATE_ARGS (args); for (ix = 0; ix != len; ix++) { tree arg = TREE_VEC_ELT (args, ix); |