[Bug c++/109774] template function causes Spurious dangling reference warning while non-template does not
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109774 Marek Polacek changed: What|Removed |Added Resolution|--- |FIXED Status|ASSIGNED|RESOLVED --- Comment #5 from Marek Polacek --- Fixed.
[Bug c++/109774] template function causes Spurious dangling reference warning while non-template does not
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109774 --- Comment #4 from CVS Commits --- The releases/gcc-13 branch has been updated by Marek Polacek : https://gcc.gnu.org/g:22741a09a8cbf8a360e99e530b016233dd705ce4 commit r13-7337-g22741a09a8cbf8a360e99e530b016233dd705ce4 Author: Marek Polacek Date: Tue May 16 14:12:06 2023 -0400 c++: -Wdangling-reference not suppressed in template [PR109774] In check_return_expr, we suppress the -Wdangling-reference warning when we're sure it would be a false positive. It wasn't working in a template, though, because the suppress_warning call was never reached. PR c++/109774 gcc/cp/ChangeLog: * typeck.cc (check_return_expr): In a template, return only after suppressing -Wdangling-reference. gcc/testsuite/ChangeLog: * g++.dg/warn/Wdangling-reference13.C: New test. (cherry picked from commit f25d2de17663a0132f9fe090dee39d3b1132067b)
[Bug c++/109774] template function causes Spurious dangling reference warning while non-template does not
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109774 --- Comment #3 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:f25d2de17663a0132f9fe090dee39d3b1132067b commit r14-919-gf25d2de17663a0132f9fe090dee39d3b1132067b Author: Marek Polacek Date: Tue May 16 14:12:06 2023 -0400 c++: -Wdangling-reference not suppressed in template [PR109774] In check_return_expr, we suppress the -Wdangling-reference warning when we're sure it would be a false positive. It wasn't working in a template, though, because the suppress_warning call was never reached. PR c++/109774 gcc/cp/ChangeLog: * typeck.cc (check_return_expr): In a template, return only after suppressing -Wdangling-reference. gcc/testsuite/ChangeLog: * g++.dg/warn/Wdangling-reference13.C: New test.
[Bug c++/109774] template function causes Spurious dangling reference warning while non-template does not
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109774 Marek Polacek changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org Status|NEW |ASSIGNED --- Comment #2 from Marek Polacek --- Here it comes down to 13900 || warning_suppressed_p (fndecl, OPT_Wdangling_reference) in do_warn_dangling_reference. So it's about the propagation of the suppression bits.
[Bug c++/109774] template function causes Spurious dangling reference warning while non-template does not
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109774 Patrick Palka changed: What|Removed |Added Last reconfirmed||2023-05-09 Status|UNCONFIRMED |NEW CC||mpolacek at gcc dot gnu.org, ||ppalka at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Patrick Palka --- Thanks for the report, confirmed.