This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14661] [3.3?/3.4/3.5 Regression] ?: operator result structure's member array can't be assigned to pointer
- From: "jsm at polyomino dot org dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Mar 2004 09:52:38 -0000
- Subject: [Bug c/14661] [3.3?/3.4/3.5 Regression] ?: operator result structure's member array can't be assigned to pointer
- References: <20040320011934.14661.dmj36@email.byu.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jsm at polyomino dot org dot uk 2004-03-22 09:52 -------
Subject: Re: [3.3? Regression] ?: operator result structure's
member array can't be assigned to pointer
On Mon, 22 Mar 2004, bangerth at dealii dot org wrote:
> In C, the result of the ?: operator is an rvalue, i.e.
> ( i ? a : b )
> is a temporary of type A, and taking the address of its member
> is assigning the address of a temporary to the result variable.
> That should be legal, but should also yield undefined behavior.
But only C99 allows the non-lvalue array to convert to a pointer like
that.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14661