TIL that in C++ it’s possible to declare variable inside of condition in if:

// Try the platform-specific fast path that avoids heap (re)allocation. Not
// all platforms implement this function.
if (auto argv = swift::getUnsafeArgvArgc(outArgLen)) {
  return argv;
}

The first fixes 1, 2, 3 in Swift thanks to PVS-Studio.