This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/68668] [6 Regression] bogus error: invalid use of array with unspecified bounds
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 Dec 2015 16:41:15 +0000
- Subject: [Bug c/68668] [6 Regression] bogus error: invalid use of array with unspecified bounds
- Auto-submitted: auto-generated
- References: <bug-68668-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68668
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Looks like this fixed it and passes dg.exp testsuite:
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -6417,6 +6417,8 @@ grokdeclarator (const struct c_declarator *declarator,
{
/* Transfer const-ness of array into that of type pointed to. */
type = TREE_TYPE (type);
+ if (orig_qual_type != NULL_TREE)
+ orig_qual_type = TREE_TYPE (orig_qual_type);
if (type_quals)
type = c_build_qualified_type (type, type_quals, orig_qual_type,
orig_qual_indirect);