Re: C++ PATCH for c++/69688 (bogus error with -Wsign-compare)

2016-02-08 Thread Jason Merrill
OK, thanks. Jason

Re: C++ PATCH for c++/69688 (bogus error with -Wsign-compare)

2016-02-08 Thread Marek Polacek
On Fri, Feb 05, 2016 at 05:36:21PM -0500, Jason Merrill wrote: > On 02/05/2016 05:32 PM, Marek Polacek wrote: > > if (TREE_CODE (type) == ERROR_MARK) > > return NULL_TREE; > > > >+ /* Here, DECL may change value; purge caches. */ > >+ clear_fold_cache (); > >+ clear_cv_cache (); > >+ > >

Re: C++ PATCH for c++/69688 (bogus error with -Wsign-compare)

2016-02-05 Thread Jason Merrill
On 02/05/2016 05:32 PM, Marek Polacek wrote: if (TREE_CODE (type) == ERROR_MARK) return NULL_TREE; + /* Here, DECL may change value; purge caches. */ + clear_fold_cache (); + clear_cv_cache (); + if (MAYBE_CLASS_TYPE_P (type)) This should happen after computing the value to be s

C++ PATCH for c++/69688 (bogus error with -Wsign-compare)

2016-02-05 Thread Marek Polacek
This issue is similar to c++/68586 -- maybe_constant_value returned stale value for a decl from the cache. Fixed by clearing the caches when we store init value for a decl. Bootstrapped/regtested on x86_64-linux, ok for trunk? 2016-02-05 Marek Polacek PR c++/69688 * typeck2.c