aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2010-05-04 09:49:45 +0000
committerDodji Seketeli <dodji@gcc.gnu.org>2010-05-04 11:49:45 +0200
commitf857e9a46ef3bfbf8e1a42aec86d7033ad343d87 (patch)
tree172380cb649bc9cd1a9292ccd5322655d0bfeb35 /gcc/cp/pt.c
parent9f1b98f0fafeb61e39ff5abc1d59f7765111db8e (diff)
downloadgcc-f857e9a46ef3bfbf8e1a42aec86d7033ad343d87.zip
gcc-f857e9a46ef3bfbf8e1a42aec86d7033ad343d87.tar.gz
gcc-f857e9a46ef3bfbf8e1a42aec86d7033ad343d87.tar.bz2
re PR c++/43953 (ICE: dependent_type_p, at cp/pt.c:17404)
Fix PR c++/43953 gcc/cp/ChangeLog: PR c++/43953 * pt.c (most_specialized_class): Pretend we are processing a template decl during the call to coerce_template_parms. gcc/testsuite/ChangeLog: PR c++/43953 * g++.dg/other/crash-12.C: New test. From-SVN: r159019
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 29489b6..fbf9b90 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -15941,12 +15941,13 @@ most_specialized_class (tree type, tree tmpl)
tree parms = TREE_VALUE (t);
partial_spec_args = CLASSTYPE_TI_ARGS (TREE_TYPE (t));
+
+ ++processing_template_decl;
+
if (outer_args)
{
int i;
- ++processing_template_decl;
-
/* Discard the outer levels of args, and then substitute in the
template args from the enclosing class. */
partial_spec_args = INNERMOST_TEMPLATE_ARGS (partial_spec_args);
@@ -15963,7 +15964,6 @@ most_specialized_class (tree type, tree tmpl)
TREE_VEC_ELT (parms, i) =
tsubst (TREE_VEC_ELT (parms, i), outer_args, tf_none, NULL_TREE);
- --processing_template_decl;
}
partial_spec_args =
@@ -15974,6 +15974,8 @@ most_specialized_class (tree type, tree tmpl)
/*require_all_args=*/true,
/*use_default_args=*/true);
+ --processing_template_decl;
+
if (partial_spec_args == error_mark_node)
return error_mark_node;