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: "nevin at eviloverlord dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jun 2008 19:06:02 -0000
- Subject: [Bug c++/36566] Cannot bind packed field
- References: <bug-36566-16349@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from nevin at eviloverlord dot com 2008-06-18 19:06 -------
Expanding on my last comment: which lines in the following code should fail to
compile:
struct Squeeze
{
short s;
} __attribute__((aligned(1), packed));
void VerticallyChallenged(short*) {}
void VerticallyChallenged(short&) {}
int main()
{
Squeeze oj;
short& pit(oj.s);
short* ppit(&oj.s);
VerticallyChallenged(ppit); // okay
VerticallyChallenged(&oj.s); // okay
VerticallyChallenged(pit); // okay
VerticallyChallenged(oj.s); // cannot bind packed field ?oj.Squeeze::s?
to ?short int&?
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36566