https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101292
--- Comment #11 from David Binderman <dcb314 at hotmail dot com> --- (In reply to Thomas Schwinge from comment #9) > (In reply to CVS Commits from comment #7) > > The warning control falls into the C++ trap of using a reference > > to old hashtable contents for a put operation which can end up > > re-allocating that before reading from the old freed referenced to > > source. Fixed by introducing a temporary. > > What the heck... I'd so much looked into this code and even refactored it > in context of my earlier commit > r12-3498-g6c79057fae6bbb36c4a4fd61c5b7107a16b71b17 "Don't maintain a warning > spec for 'UNKNOWN_LOCATION'/'BUILTINS_LOCATION' [PR101574]" -- but I had not > noticed that pre-existing problem. Thanks, Richard! > > > In the general case, this is probably too complex to get a reliable > diagnostic for (say, GCC Analyzer)? I had a look for the reallocate in put but couldn't see it. Does someone perhaps have a small chunk of C++ that demonstrates the trap ? If the analyser doesn't do it already, it ought to.