Skip to content

patch for -Wshadow-field-in-constructor #260

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

Closed

Conversation

hypatia-of-sva
Copy link

@hypatia-of-sva hypatia-of-sva commented Feb 19, 2023

This is a small patch that makes cpp2 code compile under -Wshadow, specifically -Wshadow-field-in-constructor. The only other remaining conflicts with clang's -Weverything (besides the obvious C++98 compatibilty options) are reserved identifieres with leading _ (which should be fine in a system level header) and -Wctad-maybe-unsupported, which says there should be a deduction guide for c_raii and fopen, which I would have to further look into how to implement

@hsutter
Copy link
Owner

hsutter commented Feb 19, 2023

Thanks for your pull request! It looks like this may be your first contribution to cppfront. Before I can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). Please send me your email address (by private email is fine), and I can send you one.

Repository owner deleted a comment from hypatia-of-sva Feb 19, 2023
Repository owner deleted a comment from SebastianTroy Feb 19, 2023
Repository owner deleted a comment from hypatia-of-sva Feb 19, 2023
@hsutter
Copy link
Owner

hsutter commented Feb 20, 2023

Thanks! I deleted the comments in this thread with/about the email address as it didn't seem you intended them to be visible here. I'll follow up in private email.

@hypatia-of-sva
Copy link
Author

hypatia-of-sva commented Feb 20, 2023

Okay, then thats fine, I wasnt sure which address would be appropriate to send to.

@hsutter hsutter closed this in 8dd89ec Mar 1, 2023
zaucy pushed a commit to zaucy/cppfront that referenced this pull request Dec 5, 2023
Feature: Code like `f: (out x: _) = { x = 42; }` now works, and can work with any type that is constructible from the rhs (here `42`)... see the new regression test for an example

Step toward self-hosting: Start including `cpp2util.h` in cppfront itself... and add (and use) unconditional `final_action`/`finally`

Usability: nicer diagnostics for if/else that forgot the required `{` `}` around the body

Also: closes hsutter#260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants