Export of internal Abseil changes

--
c99f979ad34f155fbeeea69b88bdc7458d89a21c by Derek Mauro <dmauro@google.com>:

Remove a floating point division by zero test.

This isn't testing behavior related to the library, and MSVC warns
about it in opt mode.

PiperOrigin-RevId: 285220804

--
68b015491f0dbf1ab547994673281abd1f34cd4b by Gennadiy Rozental <rogeeff@google.com>:

This CL introduces following changes to the class FlagImpl:
* We eliminate the CommandLineFlagLocks struct. Instead callback guard and callback function are combined into a single CallbackData struct, while primary data lock is stored separately.
* CallbackData member of class FlagImpl is initially set to be nullptr and is only allocated and initialized when a flag's callback is being set. For most flags we do not pay for the extra space and extra absl::Mutex now.
* Primary data guard is stored in data_guard_ data member. This is a properly aligned character buffer of necessary size. During initialization of the flag we construct absl::Mutex in this space using placement new call.
* We now avoid extra value copy after successful attempt to parse value out of string. Instead we swap flag's current value with tentative value we just produced.

PiperOrigin-RevId: 285132636

--
ed45d118fb818969eb13094cf7827c885dfc562c by Tom Manshreck <shreck@google.com>:

Change null-term* (and nul-term*) to NUL-term* in comments

PiperOrigin-RevId: 285036610

--
729619017944db895ce8d6d29c1995aa2e5628a5 by Derek Mauro <dmauro@google.com>:

Use the Posix implementation of thread identity on MinGW.
Some versions of MinGW suffer from thread_local bugs.

PiperOrigin-RevId: 285022920

--
39a25493503c76885bc3254c28f66a251c5b5bb0 by Greg Falcon <gfalcon@google.com>:

Implementation detail change.

Add further ABSL_NAMESPACE_BEGIN and _END annotation macros to files in Abseil.

PiperOrigin-RevId: 285012012
GitOrigin-RevId: c99f979ad34f155fbeeea69b88bdc7458d89a21c
Change-Id: I4c85d3704e45d11a9ac50d562f39640a6adbedc1
This commit is contained in:
Abseil Team 2019-12-12 10:36:03 -08:00 committed by Matt Calabrese
parent 1e39f8626a
commit 12bc53e031
339 changed files with 948 additions and 82 deletions

View file

@ -61,10 +61,12 @@
#include <any> // IWYU pragma: export
namespace absl {
ABSL_NAMESPACE_BEGIN
using std::any;
using std::any_cast;
using std::bad_any_cast;
using std::make_any;
ABSL_NAMESPACE_END
} // namespace absl
#else // ABSL_USES_STD_ANY
@ -91,6 +93,7 @@ using std::make_any;
#endif // !defined(__GNUC__) || defined(__GXX_RTTI)
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace any_internal {
@ -534,6 +537,7 @@ T* any_cast(any* operand) noexcept {
: nullptr;
}
ABSL_NAMESPACE_END
} // namespace absl
#undef ABSL_ANY_DETAIL_HAS_RTTI

View file

@ -22,6 +22,7 @@
#include "absl/base/internal/raw_logging.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
bad_any_cast::~bad_any_cast() = default;
@ -39,6 +40,7 @@ void ThrowBadAnyCast() {
}
} // namespace any_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_USES_STD_ANY

View file

@ -30,12 +30,15 @@
#include <any>
namespace absl {
ABSL_NAMESPACE_BEGIN
using std::bad_any_cast;
ABSL_NAMESPACE_END
} // namespace absl
#else // ABSL_USES_STD_ANY
namespace absl {
ABSL_NAMESPACE_BEGIN
// -----------------------------------------------------------------------------
// bad_any_cast
@ -64,6 +67,7 @@ namespace any_internal {
[[noreturn]] void ThrowBadAnyCast();
} // namespace any_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_USES_STD_ANY

View file

@ -22,6 +22,7 @@
#include "absl/base/internal/raw_logging.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
bad_optional_access::~bad_optional_access() = default;
@ -41,6 +42,7 @@ void throw_bad_optional_access() {
}
} // namespace optional_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_USES_STD_OPTIONAL

View file

@ -30,12 +30,15 @@
#include <optional>
namespace absl {
ABSL_NAMESPACE_BEGIN
using std::bad_optional_access;
ABSL_NAMESPACE_END
} // namespace absl
#else // ABSL_USES_STD_OPTIONAL
namespace absl {
ABSL_NAMESPACE_BEGIN
// -----------------------------------------------------------------------------
// bad_optional_access
@ -67,6 +70,7 @@ namespace optional_internal {
[[noreturn]] void throw_bad_optional_access();
} // namespace optional_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_USES_STD_OPTIONAL

View file

@ -23,6 +23,7 @@
#include "absl/base/internal/raw_logging.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
//////////////////////////
// [variant.bad.access] //
@ -57,6 +58,7 @@ void Rethrow() {
}
} // namespace variant_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_USES_STD_VARIANT

View file

@ -30,12 +30,15 @@
#include <variant>
namespace absl {
ABSL_NAMESPACE_BEGIN
using std::bad_variant_access;
ABSL_NAMESPACE_END
} // namespace absl
#else // ABSL_USES_STD_VARIANT
namespace absl {
ABSL_NAMESPACE_BEGIN
// -----------------------------------------------------------------------------
// bad_variant_access
@ -71,6 +74,7 @@ namespace variant_internal {
[[noreturn]] void Rethrow();
} // namespace variant_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_USES_STD_VARIANT

View file

@ -39,6 +39,7 @@
#include "absl/meta/type_traits.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace compare_internal {
using value_type = int8_t;
@ -551,6 +552,7 @@ constexpr absl::weak_ordering do_three_way_comparison(const Compare &compare,
}
} // namespace compare_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_TYPES_COMPARE_H_

View file

@ -18,6 +18,7 @@
#include "absl/base/casts.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace {
// This is necessary to avoid a bunch of lint warnings suggesting that we use
@ -334,4 +335,5 @@ TEST(Compare, StaticAsserts) {
#endif // __cpp_inline_variables
} // namespace
ABSL_NAMESPACE_END
} // namespace absl

View file

@ -26,6 +26,7 @@
#include "absl/types/internal/conformance_profile.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace types_internal {
// Creates both a Profile and a corresponding Archetype with root name "name".
@ -438,6 +439,7 @@ using ExpandSupportedProfiles = Receiver<
// (potentially) non-noexcept moves.
} // namespace types_internal
ABSL_NAMESPACE_END
} // namespace absl
#undef ABSL_INTERNAL_PROFILE_AND_ARCHETYPE_ALIAS

View file

@ -43,6 +43,7 @@
#include "absl/types/internal/conformance_profile.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace types_internal {
// A minimum-conforming implementation of a type with properties specified in
@ -961,6 +962,7 @@ struct EnabledHash {
};
} // namespace types_internal
ABSL_NAMESPACE_END
} // namespace absl
namespace std {

View file

@ -44,6 +44,7 @@
// TODO(calabrese) Add support for extending profiles.
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace types_internal {
template <class T, class /*Enabler*/ = void>
@ -369,6 +370,7 @@ template <class T>
struct IsProfile : IsProfileImpl<T>::type {};
} // namespace types_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_TYPES_INTERNAL_CONFORMANCE_PROFILE_H_

View file

@ -54,6 +54,7 @@
#endif
namespace absl {
ABSL_NAMESPACE_BEGIN
// Forward declaration
template <typename T>
@ -387,6 +388,7 @@ struct optional_hash_base<T, decltype(std::hash<absl::remove_const_t<T> >()(
};
} // namespace optional_internal
ABSL_NAMESPACE_END
} // namespace absl
#undef ABSL_OPTIONAL_USE_INHERITING_CONSTRUCTORS

View file

@ -26,6 +26,7 @@
#include "absl/meta/type_traits.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace span_internal {
// A constexpr min function
@ -121,6 +122,7 @@ template <typename From, typename To>
using EnableIfConvertibleTo =
typename std::enable_if<IsConvertible<From, To>::value>::type;
} // namespace span_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_TYPES_INTERNAL_SPAN_H_

View file

@ -40,6 +40,7 @@
#if !defined(ABSL_USES_STD_VARIANT)
namespace absl {
ABSL_NAMESPACE_BEGIN
template <class... Types>
class variant;
@ -1638,6 +1639,7 @@ struct VariantHashBase<Variant,
};
} // namespace variant_internal
ABSL_NAMESPACE_END
} // namespace absl
#endif // !defined(ABSL_USES_STD_VARIANT)

View file

@ -43,11 +43,13 @@
#include <optional> // IWYU pragma: export
namespace absl {
ABSL_NAMESPACE_BEGIN
using std::bad_optional_access;
using std::optional;
using std::make_optional;
using std::nullopt_t;
using std::nullopt;
ABSL_NAMESPACE_END
} // namespace absl
#else // ABSL_USES_STD_OPTIONAL
@ -65,6 +67,7 @@ using std::nullopt;
#include "absl/types/internal/optional.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
// nullopt_t
//
@ -754,6 +757,7 @@ constexpr auto operator>=(const U& v, const optional<T>& x)
return static_cast<bool>(x) ? static_cast<bool>(v >= *x) : true;
}
ABSL_NAMESPACE_END
} // namespace absl
namespace std {

View file

@ -24,6 +24,7 @@
#include "absl/base/internal/exception_safety_testing.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace {
@ -285,6 +286,7 @@ TEST(OptionalExceptionSafety, NothrowMoveAssign) {
} // namespace
ABSL_NAMESPACE_END
} // namespace absl
#endif // #if !defined(ABSL_USES_STD_OPTIONAL) && defined(ABSL_HAVE_EXCEPTIONS)

View file

@ -71,6 +71,7 @@
#include "absl/types/internal/span.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
//------------------------------------------------------------------------------
// Span
@ -707,5 +708,6 @@ template <int&... ExplicitArgumentBarrier, typename T, size_t N>
constexpr Span<const T> MakeConstSpan(const T (&array)[N]) noexcept {
return Span<const T>(array, N);
}
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_TYPES_SPAN_H_

View file

@ -50,6 +50,7 @@
#include <variant> // IWYU pragma: export
namespace absl {
ABSL_NAMESPACE_BEGIN
using std::bad_variant_access;
using std::get;
using std::get_if;
@ -62,6 +63,7 @@ using std::variant_npos;
using std::variant_size;
using std::variant_size_v;
using std::visit;
ABSL_NAMESPACE_END
} // namespace absl
#else // ABSL_USES_STD_VARIANT
@ -77,6 +79,7 @@ using std::visit;
#include "absl/types/internal/variant.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
// -----------------------------------------------------------------------------
// absl::variant
@ -795,6 +798,7 @@ operator>=(const variant<Types...>& a, const variant<Types...>& b) {
a.index());
}
ABSL_NAMESPACE_END
} // namespace absl
namespace std {
@ -815,6 +819,7 @@ struct hash<absl::variant<T...>>
#endif // ABSL_USES_STD_VARIANT
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace variant_internal {
// Helper visitor for converting a variant<Ts...>` into another type (mostly
@ -850,6 +855,7 @@ To ConvertVariantTo(Variant&& variant) {
std::forward<Variant>(variant));
}
ABSL_NAMESPACE_END
} // namespace absl
#endif // ABSL_TYPES_VARIANT_H_

View file

@ -28,6 +28,7 @@
#include "absl/utility/utility.h"
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace {
template <std::size_t I>
@ -217,4 +218,5 @@ BENCHMARK_TEMPLATE(BM_RedundantVisit, 4, 2)
->DenseRange(0, integral_pow(4, 2) - 1);
} // namespace
ABSL_NAMESPACE_END
} // namespace absl

View file

@ -34,6 +34,7 @@
#if !defined(ABSL_INTERNAL_MSVC_2017_DBG_MODE)
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace {
using ::testing::MakeExceptionSafetyTester;
@ -523,6 +524,7 @@ TEST(VariantExceptionSafetyTest, Swap) {
}
} // namespace
ABSL_NAMESPACE_END
} // namespace absl
#endif // !defined(ABSL_INTERNAL_MSVC_2017_DBG_MODE)

View file

@ -70,6 +70,7 @@ struct hash<Hashable> {
struct NonHashable {};
namespace absl {
ABSL_NAMESPACE_BEGIN
namespace {
using ::testing::DoubleEq;
@ -2709,6 +2710,7 @@ TEST(VariantTest, MoveCtorBug) {
}
} // namespace
ABSL_NAMESPACE_END
} // namespace absl
#endif // #if !defined(ABSL_USES_STD_VARIANT)