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

Cpp20 #4832

Merged
merged 2 commits into from
Jun 29, 2022
Merged

Cpp20 #4832

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ UseTab: Never
ColumnLimit: 0
---
Language: Cpp
Standard: c++17
Standard: c++20
# Customize only those options that differ from the base style!
# Dumping the options of the base style for comparison:
# clang-format -style=google -dump-config > .clang-format_google
Expand Down
17 changes: 1 addition & 16 deletions src/util/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,4 @@
#error We do not support your compiler. Please email [email protected] and tell us about your use case.
#endif

#if defined(__clang__) && defined(__has_warning)
#if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
#define M_FALLTHROUGH_INTENDED [[clang::fallthrough]]
#endif
#elif defined(__GNUC__) && __GNUC__ >= 7
// Taken from https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-fallthrough_003d
// We could also use a comment, but that would require ccache users to set the
// keep_comments_cpp option. If we switch to C++17, we can use [[fallthough]].
#define M_FALLTHROUGH_INTENDED __attribute__ ((fallthrough));
#endif

#ifndef M_FALLTHROUGH_INTENDED
#define M_FALLTHROUGH_INTENDED \
do { \
} while (0)
#endif
#define M_FALLTHROUGH_INTENDED [[fallthrough]]