From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17100 invoked by alias); 18 Jun 2008 19:06:45 -0000 Received: (qmail 16917 invoked by uid 48); 18 Jun 2008 19:06:02 -0000 Date: Wed, 18 Jun 2008 19:06:00 -0000 Message-ID: <20080618190602.16916.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/36566] Cannot bind packed field In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "nevin at eviloverlord dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg01096.txt.bz2 ------- 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