This is the mail archive of the gcc-patches@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]

Re: [patch] Fix PR c++/27572: ICE on typedef in parameter declaration


Volker Reichelt wrote:

> The patch is mostly mechanical, as it replaces all uses of
> "declspecs->specs[(int)ds_typedef]" by "typedefp". The only interesting
> part is the third hunk where typedefp is reset for parameters.

Why not just return error_mark_node at that point?

> Btw, "typedefp" is now the sixth variable to track the status of
> declspecs locally in grokdeclarator. Wouldn't it make more sense in
> the long run to skip the "const" in "declspecs" and modify the
> original specs direcly?

IIRC, the point is that the same specifiers are reused for multiple
declarators, in something like "static const int i, *j;" and we want to
avoid modifying the behavior on the second declarator.  You could indeed
make a copy of the specs in grokdeclarator, and use that.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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