On Thu, 3 Dec 2015, Marek Polacek wrote: > This ought to fix the fallout from PR c/68162 fix. Here the problem is that > grokdeclarator created a wrong type for PARM_DECL "p". It created this decl > with type "const int[<unknown>] *" while it should be "const int *". > > I think the problem is that we weren't using TREE_TYPE on orig_qual_type and > thus c_build_qualified_type and subsequent c_build_pointer_type might create > a bogus type. So when we're transfering const-ness of an array into that of > type pointed to, use TREE_TYPE not only of "type", but even of the orig qual > type.
I think you also need to decrement orig_qual_indirect, which counts the number of levels of array type derivation from orig_qual_type. -- Joseph S. Myers jos...@codesourcery.com