This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65786] Wrong code when using decltype to specify the return type
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 16 Apr 2015 08:39:58 +0000
- Subject: [Bug c++/65786] Wrong code when using decltype to specify the return type
- Auto-submitted: auto-generated
- References: <bug-65786-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65786
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this is undefined code as you are std::max returns a reference so you
are returning a reference to a temp variable which went out of scope.