So, the issue here is that fold_non_dependent_expr_sfinae checks potential_constant_expression, and doesn't fold anything which isn't one.

One approach would be to only guard cxx_constant_value with require_potential_constant_expression within a template.

Another approach would be to check potential_constant_expression at the same place that we check type/value_dependent_expression_p, i.e. in cp_finish_decl and convert_template_argument.

Jason

Reply via email to