[Bug c/68668] [6 Regression] bogus error: invalid use of array with unspecified bounds
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Dec 3 16:41:00 GMT 2015
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);
More information about the Gcc-bugs
mailing list