On Wed, Jan 4, 2017 at 9:33 AM, Nathan Sidwell <nat...@acm.org> wrote: > On 01/04/2017 12:40 AM, Jason Merrill wrote: >> On 12/16/2016 07:23 AM, Nathan Sidwell wrote: >>> >>> when cxx_eval_constant_expression finds a nonconstant expression it >>> returns a TREE without TREE_CONSTANT set. >>> else if (non_constant_p && TREE_CONSTANT (r)) >>> { >>> /* This isn't actually constant, so unset TREE_CONSTANT. */ > >> Hmm, we shouldn't get here for an expression we're going to use as an >> lvalue. > > I don't think we know we're going to use it as an lvalue early enough. We > get here from convert_nontype_argument: > else if (INTEGRAL_OR_ENUMERATION_TYPE_P (type)) > expr = maybe_constant_value (expr);
OK, that looks like the problem; we shouldn't be calling maybe_constant_value before we perform the conversion. Jason