[PATCH] D33644: Add default values for function parameter chunks

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 28 04:28:17 PDT 2017

klimek added a comment.

In https://reviews.llvm.org/D33644#793577, @yvvan wrote:

> In https://reviews.llvm.org/D33644#793573, @klimek wrote:
> > In https://reviews.llvm.org/D33644#783903, @yvvan wrote:
> >
> > > Do not evaluate numbers.
> > >  Check for != "=" is needed not to mess with invalid default arguments or their types (without it I get "const Bar& bar = =" when Bar is not defined)
> >
> >
> > Shouldn't we than instead check that error case?
> I don't know the proper way to do that :) I also don't know the full amount of errors that might cause such behavior.
>  You can suggest the solution if you have some idea. Current one is safe because we just ignore any case that causes empty default string.

Taking your example "const Bar& bar = =" when Bar is not defined:
What happens now?  Will it be "const Bar& bar ="? I argue that is not better than "const Bar& bar = =".
Btw, can you add tests? I think that will make it easier to see what's actually happening.


More information about the cfe-commits mailing list