Skip to content

Commit

Permalink
Merge pull request #2753 from STEllAR-GROUP/fixing_fallthrough
Browse files Browse the repository at this point in the history
Fixing detection of [[fallthrough]] attribute
  • Loading branch information
hkaiser committed Jul 17, 2017
2 parents 944eb27 + d89ef9e commit bcda395
Showing 1 changed file with 8 additions and 10 deletions.
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;
}

0 comments on commit bcda395

Please sign in to comment.