Unverified Commit c0d2dbad authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Fix static_assert for C++14.

parent d26e07f6
...@@ -1809,7 +1809,7 @@ Promise<void> AsyncCapabilityStream::writeWithFds( ...@@ -1809,7 +1809,7 @@ Promise<void> AsyncCapabilityStream::writeWithFds(
ArrayPtr<const AutoCloseFd> fds) { ArrayPtr<const AutoCloseFd> fds) {
// HACK: AutoCloseFd actually contains an `int` under the hood. We can reinterpret_cast to avoid // HACK: AutoCloseFd actually contains an `int` under the hood. We can reinterpret_cast to avoid
// unnecessary memory allocation. // unnecessary memory allocation.
static_assert(sizeof(AutoCloseFd) == sizeof(int)); static_assert(sizeof(AutoCloseFd) == sizeof(int), "this optimization won't work");
auto intArray = arrayPtr(reinterpret_cast<const int*>(fds.begin()), fds.size()); auto intArray = arrayPtr(reinterpret_cast<const int*>(fds.begin()), fds.size());
// Be extra-paranoid about aliasing rules by injecting a compiler barrier here. Probably // Be extra-paranoid about aliasing rules by injecting a compiler barrier here. Probably
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment