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/69356] compound literals for scalar types are still lvalues unlike casts


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-10-07
            Summary|Wrong description of        |compound literals for
                   |compound literals for       |scalar types are still
                   |scalar types                |lvalues unlike casts
     Ever confirmed|0                           |1

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Christian Brauner from comment #0)
> In section 6.26 Compound Literals of the gcc manual it is stated that
> 
> "Compound literals for scalar types and union types are also allowed, but
> then the compound literal is equivalent to a cast."
> 
> Which is either wrong or at least misleading. A cast does not yield an
> lvalue 

It did in older versions of GCC as an extension (maybe undocumented).  So I
suspect when that extension was removed; this wording was not changed.

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