This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix 11614
Jason Merrill <jason@redhat.com> writes:
| > therefore
| >
| > struct { ary_t s; };
| >
| > should be ill-formed.
|
| That's ill-formed only because it doesn't declare anything.
|
| struct A { ary_t s; };
|
| is fine because s is a flexible array member.
Well, I was not even considering that aspect :-)
| Under the C99 rules, you
| just can't create an object of type struct A.
|
| > 3.9/6
| >
| > A class that has been declared but not defined, or an array of
| > unknown size or of incomplete element type, is an
| > incompletely-defined object type.38) Incompletely-defined object
| > types and the void types are incomplete types (3.9.1). Objects
| > shall not be defined to have an incomplete type.
|
| Obviously the use of any C99 features in C++ is an extension which is not
| reflected in the C++ standard.
Sure, I'm well aware of that evidence.
The point I'm trying to get at is precisely where the border line
should be drawn between "incomplete but accepted" and "incomplete but
rejected" and I don't have the impression the picture is clear.
-- Gaby