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/65106] C99 intialization of struct with const member through a non-const pointer


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65106

--- Comment #1 from joseph at codesourcery dot com <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.)


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