tree inner_args;
tree new_args;
tree new_inner_args;
+ bool saved_skip_evaluation;
inner_args = INNERMOST_TEMPLATE_ARGS (args);
nargs = inner_args ? NUM_TMPL_ARGS (inner_args) : 0;
return error_mark_node;
}
+ /* We need to evaluate the template arguments, even though this
+ template-id may be nested within a "sizeof". */
+ saved_skip_evaluation = skip_evaluation;
+ skip_evaluation = false;
new_inner_args = make_tree_vec (nparms);
new_args = add_outermost_template_args (args, new_inner_args);
for (i = 0; i < nparms; i++)
lost++;
TREE_VEC_ELT (new_inner_args, i) = arg;
}
+ skip_evaluation = saved_skip_evaluation;
if (lost)
return error_mark_node;
max = tsubst_expr (omax, args, complain, in_decl,
/*integral_constant_expression_p=*/false);
- max = fold_non_dependent_expr (max);
max = fold_decl_constant_value (max);
if (TREE_CODE (max) != INTEGER_CST
--- /dev/null
+// PR c++/29518
+
+template< bool C > int assertion_failed( int);
+template< class >
+struct N
+{
+ static bool const okay = true;
+ enum {
+ t = sizeof( assertion_failed<okay>( 0))
+ };
+};
+int main()
+{
+ N<int> n;
+}