OK, thanks.
Jason
On Mon, Sep 19, 2016 at 02:34:17PM -0400, Jason Merrill wrote:
> > For STATEMENT_LIST that is called by cxx_eval_constant_expression,
> > for BIND_EXPR if we are lucky enough that BIND_EXPR_BODY is a STATEMENT_LIST
> > too (otherwise I assume even my patch doesn't fix it, it would need to
> > verif
On Fri, Sep 16, 2016 at 4:44 PM, Jakub Jelinek wrote:
> On Fri, Sep 16, 2016 at 03:51:11PM -0400, Jason Merrill wrote:
>> On Mon, Sep 5, 2016 at 1:11 PM, Jakub Jelinek wrote:
>> > + /* If body is a statement other than STATEMENT_LIST or BIND_EXPR,
>> > + it should be skipped. E.g. switch (a
On Fri, Sep 16, 2016 at 03:51:11PM -0400, Jason Merrill wrote:
> On Mon, Sep 5, 2016 at 1:11 PM, Jakub Jelinek wrote:
> > + /* If body is a statement other than STATEMENT_LIST or BIND_EXPR,
> > + it should be skipped. E.g. switch (a) b = a; */
> > + if (TREE_CODE (body) == STATEMENT_LIST
>
On Mon, Sep 5, 2016 at 1:11 PM, Jakub Jelinek wrote:
> + /* If body is a statement other than STATEMENT_LIST or BIND_EXPR,
> + it should be skipped. E.g. switch (a) b = a; */
> + if (TREE_CODE (body) == STATEMENT_LIST
> + || TREE_CODE (body) == BIND_EXPR)
I'm nervous about this optim
Hi!
cxx_eval_switch_expr assumes that SWITCH_EXPR's body is always a
STATEMENT_LIST, but that doesn't have to be the case.
As the testcase shows, if there are any variable declarations in the
switch body, it can be also a BIND_EXPR, which cxx_eval_constant_expression
handles properly, and as bar i