C++ PATCH to reject initializating flexible array members in constructors (PR c++/72775)

Jason Merrill jason@redhat.com
Wed Dec 14 16:31:00 GMT 2016


On Wed, Dec 14, 2016 at 10:39 AM, Marek Polacek <polacek@redhat.com> wrote:
> +      if (TREE_CODE (type) == ARRAY_TYPE
> +         && TYPE_DOMAIN (type) == NULL_TREE
> +         && init != NULL_TREE)
> +       error_at (DECL_SOURCE_LOCATION (current_function_decl),
> +                 "member initializer for flexible array member");

Sorry to keep nitpicking, but let's also point to the member in
question with a follow-on inform, as with some other diagnostics in
perform_member_init.

Jason



More information about the Gcc-patches mailing list