https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109708
--- Comment #2 from sandra at gcc dot gnu.org --- I was wondering if some subsequent patch might have caused the first example to regress rather than this being a documentation bug, but it did not give a diagnostic at the time the -Wdangling-pointer support was committed, either. I'll fiddle with the example a bit to make it better illustrate the difference between level 1 and level 2, as well as making it work.