From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3735 invoked by alias); 18 Feb 2015 14:27:33 -0000 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 Received: (qmail 581 invoked by uid 55); 18 Feb 2015 14:27:30 -0000 From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/65106] C99 intialization of struct with const member through a non-const pointer Date: Wed, 18 Feb 2015 14:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg02012.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65106 --- Comment #1 from joseph at codesourcery dot com --- See the definition of "modifiable lvalue" (6.3.2.1#1): "... if it is a structure or union, does not have any member (including, recursively, any member or element of all contained aggregates or unions) with a const-qualified type". (Together with 6.5.16#2 "An assignment operator shall have a modifiable lvalue as its left operand.".) (It is however valid to pass arguments and return values of such types, notwithstanding references to assignment in such contexts; see DR#427.)