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/14661] [3.3? Regression] ?: operator result structure's member array can't be assigned to pointer


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-03-20 02:54 -------
The code used to compile with gcc 2.95.x - 3.0.x, but ICEd with 3.1 - 3.3.1.
Since gcc 3.3.2 the ICE is gone - the code is rejected.

But is the code really invalid?
The code does compile as C++ source or with the option "-std=c99".
It also compiles, if I replace the condition (source == FOREIGN)
with a constant.

Here's a shorter example that demonstrates the problem:

======================================
struct A
{
    char str[1];
};

struct A a = { "" };
struct A b = { "" };

void foo (int i)
{
    char *p = ( i ? a : b ).str;
}
======================================


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
      Known to fail|3.3.1                       |3.1 3.1.1 3.1.2 3.2 3.2.1
                   |                            |3.2.2 3.2.3 3.3 3.3.1
      Known to work|3.4.0 3.5.0 3.0.4 3.2.3     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14661


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