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

Reply via email to