public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109774] New: Spurious dangling reference warning in GCC 13 - another variant
@ 2023-05-08 15:19 minty.bobby at gmail dot com
  2023-05-09 13:21 ` [Bug c++/109774] template function causes Spurious dangling reference warning while non-template does not ppalka at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: minty.bobby at gmail dot com @ 2023-05-08 15:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109774

            Bug ID: 109774
           Summary: Spurious dangling reference warning in GCC 13 -
                    another variant
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: minty.bobby at gmail dot com
  Target Milestone: ---

Created attachment 55021
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55021&action=edit
the function get() gives a spurious warning, but the very similar function
get2() does not

Similar to some of the other bug reports involving the new  dangling reference
warning, but here we have 2 very similar functions, and only one gives the
warning. Perhaps there is scope to tweak the heuristics to improve this case? 

In the attached file, the templated function get() gives a spurious warning,
but the very similar but non-template function get2() does not.

Note the reference passed in is of a different type to the reference that is
returned - I don't feel there should be confusion between them?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-16 19:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-08 15:19 [Bug c++/109774] New: Spurious dangling reference warning in GCC 13 - another variant minty.bobby at gmail dot com
2023-05-09 13:21 ` [Bug c++/109774] template function causes Spurious dangling reference warning while non-template does not ppalka at gcc dot gnu.org
2023-05-10 20:57 ` mpolacek at gcc dot gnu.org
2023-05-16 19:40 ` cvs-commit at gcc dot gnu.org
2023-05-16 19:54 ` cvs-commit at gcc dot gnu.org
2023-05-16 19:54 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).