[PATCH] Fix parsing comma in default arguments.

Olivier Goffart ogoffart at kde.org
Sun May 19 02:54:27 PDT 2013


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.



More information about the cfe-commits mailing list