MISRA Discussion Forums

Full Version: Rule 6-2-3 and C++17 [[fallthrough]]; attribute
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Should the C++17 [[fallthrough]]; attribute be given an exception for MISRA C++ 2008 Rule 6-2-3 (a null statement shall appear on a line by itself)?
The short and unhelpful answer is that [[fallthrough]] was introduced to C++ after MISRA 2008 had been published, so is out of scope of any MISRA 2008 rule.

Having said that, looking at the rationale for 6-2-3, if this were still a requirement, then  "[[fallthrough]]; // comment"    should be acceptable as a null-statement on a single line