This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67795] Wrong code generated for conditional expression with cast
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Oct 2015 21:45:37 +0000
- Subject: [Bug c++/67795] Wrong code generated for conditional expression with cast
- Auto-submitted: auto-generated
- References: <bug-67795-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67795
Marc Glisse <glisse at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-10-01
Version|unknown |5.2.0
Target Milestone|--- |5.3
Ever confirmed|0 |1
--- Comment #11 from Marc Glisse <glisse at gcc dot gnu.org> ---
With a direct return, rationalize_conditional_expr (from
convert_for_initialization) fixes the cond_expr to put lvalues back into the
branches. An old-style cast also works, but static_cast uses a different path
and misses it.