Commit f68a5213 authored by Igor Sugak's avatar Igor Sugak Committed by Facebook Github Bot

update clang-format in fbsource and format folly

Reviewed By: zertosh

Differential Revision: D9993527

fbshipit-source-id: 52c4c0bfe6b5c73c652dd350f599fb846a003a4f
parent 0289870c
......@@ -591,7 +591,7 @@ class Function final : private detail::function::FunctionTraits<FunctionType> {
// Make sure Objective C blocks are copied
template <class ReturnType, class... Args>
/*implicit*/ Function(ReturnType (^objCBlock)(Args... args))
: Function([blockCopy = (ReturnType (^)(Args...))[objCBlock copy]](
: Function([blockCopy = (ReturnType(^)(Args...))[objCBlock copy]](
Args... args) { return blockCopy(args...); }){};
#endif
......@@ -680,7 +680,7 @@ class Function final : private detail::function::FunctionTraits<FunctionType> {
// Make sure Objective C blocks are copied
template <class ReturnType, class... Args>
/* implicit */ Function& operator=(ReturnType (^objCBlock)(Args... args)) {
(*this) = [blockCopy = (ReturnType (^)(Args...))[objCBlock copy]](
(*this) = [blockCopy = (ReturnType(^)(Args...))[objCBlock copy]](
Args... args) { return blockCopy(args...); };
return *this;
}
......
......@@ -333,7 +333,9 @@ template <class T, class I>
/// \overload
template <class T, class I>
[[noreturn]] detail::AddCvrefOf<T, I> const& poly_cast(
detail::ArchetypeRoot<I> const&) { assume_unreachable(); }
detail::ArchetypeRoot<I> const&) {
assume_unreachable();
}
/// \endcond
/// \overload
......
......@@ -152,7 +152,7 @@ namespace {
// Copy pointers to the given strings in a format suitable for posix_spawn
std::unique_ptr<const char* []> cloneStrings(
const std::vector<std::string>& s) {
std::unique_ptr<const char* []> d(new const char*[s.size() + 1]);
std::unique_ptr<const char*[]> d(new const char*[s.size() + 1]);
for (size_t i = 0; i < s.size(); i++) {
d[i] = s[i].c_str();
}
......@@ -247,7 +247,7 @@ void Subprocess::setAllNonBlocking() {
}
void Subprocess::spawn(
std::unique_ptr<const char* []> argv,
std::unique_ptr<const char*[]> argv,
const char* executable,
const Options& optionsIn,
const std::vector<std::string>* env) {
......@@ -319,7 +319,7 @@ void Subprocess::spawn(
FOLLY_PUSH_WARNING
FOLLY_GCC_DISABLE_WARNING("-Wclobbered")
void Subprocess::spawnInternal(
std::unique_ptr<const char* []> argv,
std::unique_ptr<const char*[]> argv,
const char* executable,
Options& options,
const std::vector<std::string>* env,
......@@ -382,7 +382,7 @@ void Subprocess::spawnInternal(
char** argVec = const_cast<char**>(argv.get());
// Set up environment
std::unique_ptr<const char* []> envHolder;
std::unique_ptr<const char*[]> envHolder;
char** envVec;
if (env) {
envHolder = cloneStrings(*env);
......
......@@ -887,12 +887,12 @@ class Subprocess {
// spawnInternal() returns it reads the error pipe to see if the child
// encountered any errors.
void spawn(
std::unique_ptr<const char* []> argv,
std::unique_ptr<const char*[]> argv,
const char* executable,
const Options& options,
const std::vector<std::string>* env);
void spawnInternal(
std::unique_ptr<const char* []> argv,
std::unique_ptr<const char*[]> argv,
const char* executable,
Options& options,
const std::vector<std::string>* env,
......
......@@ -335,10 +335,11 @@ struct ArchetypeBase : Bottom {
template <class T>
/* implicit */ ArchetypeBase(T&&);
template <std::size_t, class... As>
[[noreturn]] Bottom _polyCall_(As&&...) const { std::terminate(); }
[[noreturn]] Bottom _polyCall_(As&&...) const {
std::terminate();
}
friend bool
operator==(ArchetypeBase const&, ArchetypeBase const&);
friend bool operator==(ArchetypeBase const&, ArchetypeBase const&);
friend bool operator!=(ArchetypeBase const&, ArchetypeBase const&);
friend bool operator<(ArchetypeBase const&, ArchetypeBase const&);
friend bool operator<=(ArchetypeBase const&, ArchetypeBase const&);
......
......@@ -66,8 +66,8 @@ void moveTopException(StackTraceStack& from, StackTraceStack& to) {
struct Initializer {
Initializer() {
registerCxaThrowCallback([](
void*, std::type_info*, void (*)(void*)) noexcept {
registerCxaThrowCallback(
[](void*, std::type_info*, void (*)(void*)) noexcept {
addActiveException();
});
......@@ -101,9 +101,8 @@ struct Initializer {
}
});
registerRethrowExceptionCallback([](std::exception_ptr) noexcept {
addActiveException();
});
registerRethrowExceptionCallback(
[](std::exception_ptr) noexcept { addActiveException(); });
try {
::folly::exception_tracer::installHandlers();
......
......@@ -499,9 +499,8 @@ TEST(IsNothrowApplicable, Basic) {
(folly::is_nothrow_applicable<decltype(f), std::tuple<int>>{}));
}
{
auto f = folly::overload([](int) noexcept {}, [](double) -> double {
return {};
});
auto f = folly::overload(
[](int) noexcept {}, [](double) -> double { return {}; });
EXPECT_FALSE(
(folly::is_nothrow_applicable<decltype(f), std::tuple<double>>{}));
EXPECT_TRUE((folly::is_nothrow_applicable<decltype(f), std::tuple<int>>{}));
......@@ -520,9 +519,8 @@ TEST(IsApplicableR, Basic) {
(folly::is_applicable_r<double, decltype(f), std::tuple<int>>{}));
}
{
auto f = folly::overload([](int) noexcept {}, [](double) -> double {
return {};
});
auto f = folly::overload(
[](int) noexcept {}, [](double) -> double { return {}; });
EXPECT_TRUE(
(folly::is_applicable_r<float, decltype(f), std::tuple<double>>{}));
EXPECT_TRUE((folly::is_applicable_r<void, decltype(f), std::tuple<int>>{}));
......@@ -545,9 +543,8 @@ TEST(IsNothrowApplicableR, Basic) {
is_nothrow_applicable_r<double, decltype(f), std::tuple<int>>{}));
}
{
auto f = folly::overload([](int) noexcept {}, [](double) -> double {
return {};
});
auto f = folly::overload(
[](int) noexcept {}, [](double) -> double { return {}; });
EXPECT_FALSE((
folly::
is_nothrow_applicable_r<float, decltype(f), std::tuple<double>>{}));
......
......@@ -699,7 +699,9 @@ TEST(SemiFuture, MakeSemiFutureFromFutureWithTry) {
}
namespace {
[[noreturn]] void deferHelper(folly::Try<folly::Unit>&&) { throw eggs; }
[[noreturn]] void deferHelper(folly::Try<folly::Unit>&&) {
throw eggs;
}
} // namespace
TEST(SemiFuture, DeferWithinContinuation) {
......
......@@ -243,8 +243,7 @@ TEST(Json, JsonNonAsciiEncoding) {
// multiple unicode encodings
EXPECT_EQ(
folly::json::serialize("\x1f\xe2\x82\xac", opts),
R"("\u001f\u20ac")");
folly::json::serialize("\x1f\xe2\x82\xac", opts), R"("\u001f\u20ac")");
EXPECT_EQ(
folly::json::serialize("\x1f\xc2\xa2\xe2\x82\xac", opts),
R"("\u001f\u00a2\u20ac")");
......
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