http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48685
--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-04-21 15:36:26 UTC --- The C front end should not depend on fold creating NON_LVALUE_EXPRs anywhere, but I don't know if C++ has such dependencies. Where does the NON_LVALUE_EXPR come from? In any case, I don't think NON_LVALUE_EXPR should be used for type conversions; a NON_LVALUE_EXPR with void type should only ever be used if the contained expression has void type (with the same qualifiers), and under those conditions STRIP_TYPE_NOPS should remove it. c_fully_fold_internal needs to preserve the type of the expression, so can't just remove a NON_LVALUE_EXPR that changes the type without adding some other conversion to the new type - but as noted above, if a NON_LVALUE_EXPR is changing the type I think the creation of that NON_LVALUE_EXPR is what's wrong.