diff options
author | Patrick Palka <ppalka@gcc.gnu.org> | 2015-07-10 23:21:39 +0000 |
---|---|---|
committer | Patrick Palka <ppalka@gcc.gnu.org> | 2015-07-10 23:21:39 +0000 |
commit | c5540945071f17bed8009e2cfeffd7af8e830ba7 (patch) | |
tree | 6449427b1ab698673633eb97179cc607d0dca792 /gcc/cp/error.c | |
parent | 0a73242e1ab3ac00d8fe9a98f10732473a96dc04 (diff) | |
download | gcc-c5540945071f17bed8009e2cfeffd7af8e830ba7.zip gcc-c5540945071f17bed8009e2cfeffd7af8e830ba7.tar.gz gcc-c5540945071f17bed8009e2cfeffd7af8e830ba7.tar.bz2 |
re PR c++/30044 (ICE in tsubst, at cp/pt.c:7359)
Fix PR c++/30044
gcc/cp/ChangeLog:
PR c++/30044
* pt.c (begin_template_parm_list): Add a dummy parameter level
to current_template_parms.
(end_template_parm_list): Remove the dummy parameter level
before adding the real one.
(tsubst): Don't attempt to substitute for template parameters
corresponding to a dummy argument level.
(template_parms_to_args): Remove obsolete hack for
giving template template arguments the proper level.
(splite_late_return_type): Remove obsolete hack for giving
template template arguments the proper level.
* error.c (dump_template_decl): Don't print dummy template
levels.
gcc/testsuite/ChangeLog
PR c++/30044
* g++.dg/cpp0x/auto46.C: New test.
* g++.dg/template/pr30044.C: New test.
* g++.dg/template/shadow2.C: New test.
* g++.dg/template/error55.C: New test.
* g++.dg/template/crash83.C: Accept any error string.
* g++.dg/cpp0x/variadic18.C: Adjust to avoid shadowing template
parameters.
* g++.dg/cpp0x/variadic18.C: Likewise
* g++.dg/template/canon-type-13.C: Likewise.
* g++.old-deja/g++.pt/ttp42.C: Likewise.
* g++.dg/torture/20070621-1.C: Likewise.
From-SVN: r225706
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index b2b0638..b811df2 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1295,6 +1295,14 @@ dump_template_decl (cxx_pretty_printer *pp, tree t, int flags) tree inner_parms = INNERMOST_TEMPLATE_PARMS (parms); int len = TREE_VEC_LENGTH (inner_parms); + if (len == 0) + { + /* Skip over the dummy template levels of a template template + parm. */ + gcc_assert (TREE_CODE (TREE_TYPE (t)) == TEMPLATE_TEMPLATE_PARM); + continue; + } + pp_cxx_ws_string (pp, "template"); pp_cxx_begin_template_argument_list (pp); |