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

cpp: support/CPPUtils.cpp: replace clang attribute [[clang::fallthrou… #3382

Closed

Conversation

enedil
Copy link

@enedil enedil commented Dec 2, 2021

…gh]]

[[clang::fallthrough]] has been used to mark a switch branch target to
be falling through, however just if clang has been used.
Since C++17, [[fallthrough]] is a part of the standard:
https://en.cppreference.com/w/cpp/language/attributes/fallthrough

It's recoginzed by MSVC, clang, GCC and respected when using all the C++
versions at least from C++11 upwards.

This change also removes warning in the switch, which would happen when
compiling with GCC.

…gh]]

[[clang::fallthrough]] has been used to mark a switch branch target to
be falling through, however just if `clang` has been used.
Since C++17, [[fallthrough]] is a part of the standard:
https://en.cppreference.com/w/cpp/language/attributes/fallthrough

It's recoginzed by MSVC, clang, GCC and respected when using all the C++
versions at least from C++11 upwards.

This change also removes warning in the switch, which would happen when
compiling with GCC.
@mike-lischke
Copy link
Member

@enedil Thanks for the patch, however this problem will be solved by PR #3395.

@enedil
Copy link
Author

enedil commented Dec 7, 2021

In that case, I'll close the PR.

@enedil enedil closed this Dec 7, 2021
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