mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-18 13:14:40 +03:00
Fix #1004
This commit is contained in:
@@ -12191,8 +12191,9 @@ If you really need to break out a loop, a `break` is typically better than alter
|
||||
break;
|
||||
case Warning:
|
||||
write_event_log();
|
||||
// Bad - implicit fallthrough
|
||||
case Error:
|
||||
display_error_window(); // Bad
|
||||
display_error_window();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -12206,7 +12207,7 @@ It is easy to overlook the fallthrough. Be explicit:
|
||||
write_event_log();
|
||||
// fallthrough
|
||||
case Error:
|
||||
display_error_window(); // Bad
|
||||
display_error_window();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -12220,7 +12221,7 @@ In C++17, use a `[[fallthrough]]` annotation:
|
||||
write_event_log();
|
||||
[[fallthrough]]; // C++17
|
||||
case Error:
|
||||
display_error_window(); // Bad
|
||||
display_error_window();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user