Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj

This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

Differential Revision: https://phabricator.services.mozilla.com/D56440
This commit is contained in:
Chris Peterson
2019-12-20 07:16:43 +00:00
parent 0fa3aa0589
commit 0a9155f83b
136 changed files with 283 additions and 302 deletions

View File

@@ -3887,7 +3887,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
break; // If we are submitting, do not send click event
}
// else fall through and treat Space like click...
MOZ_FALLTHROUGH;
[[fallthrough]];
}
case NS_FORM_INPUT_BUTTON:
case NS_FORM_INPUT_RESET:
@@ -3909,7 +3909,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
case NS_VK_UP:
case NS_VK_LEFT:
isMovingBack = true;
MOZ_FALLTHROUGH;
[[fallthrough]];
case NS_VK_DOWN:
case NS_VK_RIGHT:
// Arrow key pressed, focus+select prev/next radio button