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

Implicit fallthroughs #4929

Open
r-barnes opened this issue Jul 31, 2024 · 1 comment
Open

Implicit fallthroughs #4929

r-barnes opened this issue Jul 31, 2024 · 1 comment
Assignees
Labels
enhancement waiting-for-feedback Reporter's feedback has been requested

Comments

@r-barnes
Copy link

Are these implicit fallthroughs intentional? If so, can we mark them with [[fallthrough]]?

default: end_loop = true;

@r-barnes r-barnes added the bug label Jul 31, 2024
@kkm000 kkm000 added enhancement and removed bug labels Aug 28, 2024
@kkm000
Copy link
Contributor

kkm000 commented Aug 28, 2024

Yes. In both cases, we've just read the closing token <!EndOfComponent> and are falling through the default case, or didn't read any tokens at all, and breaking the loop at the first iteration.

[[fallthrough]] would be nice indeed. I guess the C++17 compiler yells at you? A C++14-compatible alternative is to repeat end_loop = true; and have the case end with the break;

@jtrmal, @danpovey, we are C++17 by default now, ain't we? No longer C++14? I can't think of a compiler that wouldn't C++17 these days.

@kkm000 kkm000 added the waiting-for-feedback Reporter's feedback has been requested label Aug 28, 2024
@kkm000 kkm000 self-assigned this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement waiting-for-feedback Reporter's feedback has been requested
Projects
None yet
Development

No branches or pull requests

2 participants