[PATCH] Fix parsing comma in default arguments.

Olivier Goffart ogoffart at kde.org
Fri May 31 02:47:12 PDT 2013


Ping ?

In the mean time, i realized there is no need to test for r_paren because 
SkipUntil already does it. Hence the slightly modified attached patch.



On Sunday 19 May 2013 11:54:27 Olivier Goffart wrote:
> On Sunday 19 May 2013 11:45:57 Olivier Goffart wrote:
> > Hi,
> > 
> > I attached a patch to the bug http://llvm.org/bugs/show_bug.cgi?id=14486
> 
> Wrong link. I meant
> http://llvm.org/bugs/show_bug.cgi?id=13657
> 
> Sorry for the confusion.
> 
> > The problem is that a comma can be both the separation between template
> > parameter, or the separation between function arguments.
> > 
> > GCC tries to fully parse the part after the comma to see if it can be the
> > separation between function argument:
> > http://code.woboq.org/gcc/gcc/cp/parser.c.html#23442
> > 
> > But I was too lazy to do the same (because the function like
> > TryParseParameterDeclarationClause or TryParseDeclarationSpecifier are not
> > good enough and stop too early.)
> > So Instead I used some heuristics in the existence of a '=' before the
> > possible closing '>' as further argument need to find a comma.
> > 
> > I am not 100% sure that this cover all the cases, but i could not find an
> > example that breaks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-parsing-comma-in-default-argument.patch
Type: text/x-patch
Size: 7612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130531/16a0c79c/attachment.bin>


More information about the cfe-commits mailing list