public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Marek Polacek <polacek@redhat.com>,
	Richard Biener <rguenther@suse.de>,	<gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Allow relayout_decl on FIELD_DECLs (PR c/72816)
Date: Mon, 08 Aug 2016 11:04:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1608081100170.30008@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20160806190908.GB14857@tucnak.redhat.com>

On Sat, 6 Aug 2016, Jakub Jelinek wrote:

> --- gcc/testsuite/gcc.dg/pr72816.c.jj	2016-08-06 13:06:45.046003282 +0200
> +++ gcc/testsuite/gcc.dg/pr72816.c	2016-08-06 13:07:57.217093845 +0200
> @@ -0,0 +1,9 @@
> +/* PR c/72816 */
> +/* { dg-do compile } */
> +/* { dg-options "-std=gnu11" } */
> +
> +typedef const int A[];
> +struct S {
> +  int a;
> +  A b;	/* { dg-error "array size missing" } */
> +};

As far as I can tell, this is actually valid code that should not produce 
an error; the type of a flexible array member can be given by a typedef, 
and I see nothing to disallow it being given by a typedef for an array of 
qualified type.  Note that both the version of this test without const, 
and the version with const but not using a typedef, are accepted.

-- 
Joseph S. Myers
joseph@codesourcery.com

  parent reply	other threads:[~2016-08-08 11:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-06 19:09 Jakub Jelinek
2016-08-07  7:14 ` Richard Biener
2016-08-08 11:04 ` Joseph Myers [this message]
2016-08-08 11:53   ` Marek Polacek
2016-08-10 15:19   ` Jakub Jelinek
2016-08-10 15:31     ` Joseph Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1608081100170.30008@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=polacek@redhat.com \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).