boost_fallthrough_test.cpp 416 B

123456789101112131415161718192021
  1. // (C) Copyright John Maddock 2013.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #include <boost/config.hpp>
  6. int test(int n)
  7. {
  8. switch (n)
  9. {
  10. case 0:
  11. n++;
  12. BOOST_FALLTHROUGH;
  13. case 1:
  14. n++;
  15. break;
  16. }
  17. return n;
  18. }