https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99974
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=99972 --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- This never worked correctly so it's not a regression. Clang behaves as expected in both C and C++ modes and issues the following warnings: z.C:18:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] fwur (); // -Wunused-result (good) ^~~~ z.C:25:3: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result] fwur (); // missing -Wunused-result (bug) ^~~~ 2 warnings generated.