Re: Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-16 Thread Martin Sebor
I think this caused PR68932 - FAIL: obj-c++.dg/property/at-property-23.mm -fgnu-runtime (internal compiler error) Sorry about that. I'll look into it today. Martin

Re: Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-16 Thread Martin Sebor
I think this caused PR68932 - FAIL: obj-c++.dg/property/at-property-23.mm -fgnu-runtime (internal compiler error) Sorry about that. I'll look into it today. Martin

Re: Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-15 Thread Tom de Vries
On 14/12/15 17:45, Martin Sebor wrote: gcc/testsuite/ChangeLog: 2015-12-02 Martin Sebor c++/42121 c++/68478 c++/68613 c++/68689 c++/68710 * g++.dg/compat/struct-layout-1_generate.c: Avoid generating further fields after the first flexible

Re: Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-14 Thread Jason Merrill
On 12/14/2015 11:45 AM, Martin Sebor wrote: + if (NULL_TREE == size) Usually NULL_TREE goes on the right. @@ -8744,6 +8748,7 @@ compute_array_index_type (tree name, tree size, tsubst_flags_t complain) else pedwarn (input_location, OPT_Wpedantic, "ISO C++ forbids zero-s

Re: Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-14 Thread Jakub Jelinek
On Mon, Dec 14, 2015 at 09:45:16AM -0700, Martin Sebor wrote: > --- a/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c > +++ b/gcc/testsuite/g++.dg/compat/struct-layout-1_generate.c > @@ -605,8 +605,11 @@ getrandll (void) >return ret; > } > > +/* Generate a subfield. The object pointe

Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-14 Thread Martin Sebor
Ping: The most recent patch revealed a problem in the test suite where the g++.dg/compat/struct-layout-1_generate.c program generates structs with invalid flexible array members. The attached patch fixes the generator to avoid that. Jason, Are there any further changes you'd like to suggest fo

Re: Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-08 Thread Martin Sebor
Thanks for the review and the helpful hints! I've reworked and simplified the diagnostic part of the patch and corrected the remaining issues I uncovered while testing the new version (failing to reject some invalid flexible array members in base classes). Please find the new version in the atta

Re: Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-04 Thread Jason Merrill
On 12/03/2015 11:42 PM, Martin Sebor wrote: + if (next && TREE_CODE (next) == FIELD_DECL) This will break if there's a non-field between the array and the next field. @@ -4114,7 +4115,10 @@ walk_subobject_offsets (tree type, /* Avoid recursing into objects that are not interes

Re: Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-04 Thread Joseph Myers
On Thu, 3 Dec 2015, Martin Sebor wrote: > The only C change in this patch is to include the size of excessively > large types in diagnostics (I found knowing the size helpful when > adding tests and I think it might be helpful to others as well). I don't see what that C change has to do with flex

Re: Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-04 Thread Bernd Schmidt
> The patch should bring C++ support for flexible array members closer > to C (most of the same constructs should be accepted and rejected). > The only C change in this patch is to include the size of excessively > large types in diagnostics (I found knowing the size helpful when > adding tests an

Ping [PATCH] c++/42121 - diagnose invalid flexible array members

2015-12-03 Thread Martin Sebor
[CC Jason for the C++ changes and Joseph for the one C change.] Attached is a reworked and expanded patch for the bug plus three others in the same area that I uncovered while developing and testing the former patch: c++/68689 - flexible array members in unions accepted in C++ c++/68478 - flexib

[PATCH] c++/42121 - diagnose invalid flexible array members

2015-11-21 Thread Martin Sebor
Bug 42121 - g++ should warn or error on internal 0 size array in struct, is a request to diagnose declarations of flexible array members that aren't last in the enclosing struct, such as in the following: struct S { int a; char b[]; // invalid int c; }; The