OSDN Git Service

Fix PRs c++/42758, c++/42634, c++/42797
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Jan 2010 14:30:41 +0000 (14:30 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 29 Jan 2010 14:30:41 +0000 (14:30 +0000)
commit94c17f03f6125d9c2357594be55f5e6fdd054a4b
tree2ee93041dfe1e8e764098880a0e8717715707c64
parent338cce8f9ae07a2135b04b693f882c03d2de3bb5
Fix PRs c++/42758, c++/42634, c++/42797

... and mitigate PR c++/42336

gcc/cp/ChangeLog:
PR c++/42758
PR c++/42634
PR c++/42336
PR c++/42797
PR c++/42880
* cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
* pt.c (coerce_template_parms, type_unification_real,
expand_template_argument_pack, coerce_template_parameter_pack):
Set the non default template args count.
(current_template_args): Always set non defaulted
template args count when compiled with --enable-checking
(tsubst_template_args, type_unification_real): Propagate the non
defaulted template args count.
* error.c (get_non_default_template_args_count): Renamed
count_non_default_template_args into this. Don't calculate the
non default template argument count anymore. Use the new
accessor macros above to get it.
(dump_template_argument_list, dump_type, dump_decl,
dump_template_parms): Adjust.
* parser.c (cp_parser_template_argument_list): Always set defaulted
template args count when compiled with --enable-checking.

gcc/testsuite/ChangeLog:
PR c++/42758
PR c++/42634
PR c++/42336
PR c++/42797
PR c++/42880
* g++.dg/other/crash-5.C: New test.
* g++.dg/other/crash-6.C: New test.
* g++.dg/other/crash-7.C: New test.
* g++.dg/other/crash-8.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156351 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/error.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/crash-5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/crash-6.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/crash-7.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/crash-8.C [new file with mode: 0644]