This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67795] Wrong code generated for conditional expression with cast


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]