This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36566] Cannot bind packed field
- From: "xiaoj at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 18 Mar 2015 00:53:47 +0000
- Subject: [Bug c++/36566] Cannot bind packed field
- Auto-submitted: auto-generated
- References: <bug-36566-4 at http dot gcc dot gnu dot org/bugzilla/>
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);
}