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

Fixing detection of [[fallthrough]] attribute #2753

Merged
merged 1 commit into from Jul 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 8 additions & 10 deletions cmake/tests/cxx17_fallthrough_attribute.cpp
Expand Up @@ -5,17 +5,15 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
////////////////////////////////////////////////////////////////////////////////

#if !defined(__has_cpp_attribute)
# error "__has_cpp_attribute not supported, assume [[fallthrough]] is not supported"
#else
# if !__has_cpp_attribute(fallthrough)
# error "__has_cpp_attribute(fallthrough) not supported"
# endif
#endif

int main()
{
int n = 0, m = 0;
switch(n)
{
case 0:
++m;
[[fallthrough]];
case 1:
m += 2;
break;
}
return 0;
}