aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-09-16 01:50:26 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-09-16 01:50:26 +0000
commit3489ea0cb1ee05d7c65b5178cc9f382c1578f254 (patch)
tree42cb31327a251297cee280781730079e7371a689 /gcc/cp/pt.c
parentbba35acfce4ef15716ffc6dee95eb0d6e82aec9c (diff)
downloadgcc-3489ea0cb1ee05d7c65b5178cc9f382c1578f254.zip
gcc-3489ea0cb1ee05d7c65b5178cc9f382c1578f254.tar.gz
gcc-3489ea0cb1ee05d7c65b5178cc9f382c1578f254.tar.bz2
re PR c++/23896 (boost::tie() = std::pair doesn't compile)
PR c++/23896 * pt.c (tsubst_aggr_type): Make sure skip_evaluation is false when processing template arguments. PR c++/23896 * g++.dg/template/static17.C: New test. From-SVN: r104336
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 8840d27..ece9614 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6069,6 +6069,11 @@ tsubst_aggr_type (tree t,
tree argvec;
tree context;
tree r;
+ bool saved_skip_evaluation;
+
+ /* In "sizeof(X<I>)" we need to evaluate "I". */
+ saved_skip_evaluation = skip_evaluation;
+ skip_evaluation = false;
/* First, determine the context for the type we are looking
up. */
@@ -6089,12 +6094,17 @@ tsubst_aggr_type (tree t,
argvec = tsubst_template_args (TYPE_TI_ARGS (t), args,
complain, in_decl);
if (argvec == error_mark_node)
- return error_mark_node;
-
- r = lookup_template_class (t, argvec, in_decl, context,
- entering_scope, complain);
+ r = error_mark_node;
+ else
+ {
+ r = lookup_template_class (t, argvec, in_decl, context,
+ entering_scope, complain);
+ r = cp_build_qualified_type_real (r, TYPE_QUALS (t), complain);
+ }
+
+ skip_evaluation = saved_skip_evaluation;
- return cp_build_qualified_type_real (r, TYPE_QUALS (t), complain);
+ return r;
}
else
/* This is not a template type, so there's nothing to do. */