Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List initialization as function default parameter will have an extra equals sign ("="). #81

Open
yjiao-cgnx opened this issue Aug 31, 2023 · 1 comment
Labels
bug Something isn't working PR Welcome Extra attention is needed

Comments

@yjiao-cgnx
Copy link

Pretty self-explanatory. If I have a function like this:

void take_an_vector(const std::vector<int>& input = {});

The default parameter parsed through CppAST, which is the InitExpression field of CppParameter, will show up as ={}, instead of {}.
I do not see a test of this behavior. Is this expected or by design?

@xoofx xoofx added bug Something isn't working PR Welcome Extra attention is needed labels Sep 1, 2023
@xoofx
Copy link
Owner

xoofx commented Sep 1, 2023

I do not see a test of this behavior. Is this expected or by design?

Not expected. PR welcome to fix it. 🙂

@yjiao-cgnx yjiao-cgnx changed the title List initialization as function default parameter wiill have an extra equals sign ("="). List initialization as function default parameter will have an extra equals sign ("="). Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR Welcome Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants