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



------- 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


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