/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ep = std::make_exception_ptr(e);
- assert(ep);
+ bool b = static_cast<bool>(ep);
+ folly::doNotOptimizeAway(b);
}
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew);
+ bool b = static_cast<bool>(ew);
+ folly::doNotOptimizeAway(b);
}
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ep = std::make_exception_ptr(e);
- assert(ep);
+ bool b = static_cast<bool>(ep);
+ folly::doNotOptimizeAway(b);
}
});
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew);
+ bool b = static_cast<bool>(ew);
+ folly::doNotOptimizeAway(b);
}
});
}
auto ep = std::make_exception_ptr(e);
try {
std::rethrow_exception(ep);
- assert(false);
- } catch (std::runtime_error& e) {
+ } catch (std::runtime_error&) {
}
}
}
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
try {
ew.throwException();
- assert(false);
- } catch (std::runtime_error& e) {
+ } catch (std::runtime_error&) {
}
}
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew.is_compatible_with<std::runtime_error>());
+ bool b = ew.is_compatible_with<std::runtime_error>();
+ folly::doNotOptimizeAway(b);
}
}
auto ep = std::make_exception_ptr(e);
try {
std::rethrow_exception(ep);
- assert(false);
- } catch (std::runtime_error& e) {
+ } catch (std::runtime_error&) {
}
}
});
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
try {
ew.throwException();
- assert(false);
- } catch (std::runtime_error& e) {
+ } catch (std::runtime_error&) {
}
}
});
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew.is_compatible_with<std::runtime_error>());
+ bool b = ew.is_compatible_with<std::runtime_error>();
+ folly::doNotOptimizeAway(b);
}
});
}