On Sat, 22 Oct 2022 at 00:28, Marek Polacek wrote: > I've run the testsuite/bootstrap with the warning enabled by default. > There were just a few FAILs: > * g++.dg/warn/Wdangling-pointer-2.C > * 20_util/any/misc/any_cast.cc > * 20_util/forward/c_neg.cc > * 20_util/forward/f_neg.cc These two are XFAIL tests, they're checking for a required static assert due to misusing std::forward, so I don't think we want to change them to remove a "bug" (they're meant to be buggy). I think they should use -Wno-dangling-reference > * experimental/any/misc/any_cast.cc > all of these look like genuine bugs. A bootstrap with the warning > enabled by default passed. I've attached a patch for the two any_cast.cc tests that avoids creating dangling references, without changing the intended behaviour of the tests.