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++/36566] Cannot bind packed field


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

Xiao Jia <xiaoj at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xiaoj at google dot com

--- Comment #7 from Xiao Jia <xiaoj at google dot com> ---
What is the status of this?

Adding "const" makes it compile.  Is this the intended behavior or not?


struct Squeeze
{
    short   s;
} __attribute__((aligned(1), packed));

void VerticallyChallenged(const short&) {}

int main()
{
    Squeeze oj;
    const short& pit(oj.s);
    VerticallyChallenged(pit);
    VerticallyChallenged(oj.s);
}


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