This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/68668] [6 Regression] bogus error: invalid use of array with unspecified bounds


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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]