On Wed, 2 Dec 2015, Jason Merrill wrote: > As richi pointed out in another thread, calling fold in warn_tautological_cmp > is problematic because fold expects operands of its argument to have already > been folded; we really need to call *_fully_fold. > > The first patch moves c_fully_fold into the C front end, and defines it for > C++ as well.
The new file needs copyright and license notices. > The second patch defines fold_for_warn to call c_fully_fold and uses it in > places in the warn_* functions that want to know if the operand has a constant > value. > > Joseph, are these changes OK for C? The extra folding isn't currently > necessary for C, should fold_for_warn check c_dialect_cxx()? I think it should check that, yes. -- Joseph S. Myers jos...@codesourcery.com