about summary refs log tree commit diff
path: root/absl/base/exception_safety_testing_test.cc
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-02-21T20·51-0800
committerCJ Johnson <johnsoncj@google.com>2020-02-21T20·56-0500
commitb69c7d880caddfc25bf348dbcfe9d45fdd8bc6e6 (patch)
tree0ceef2d75071fdfdf7a47c2978a4df5b422001ed /absl/base/exception_safety_testing_test.cc
parent2a5633fc077a58528cdbfe78720f3f6bfdc6044d (diff)
Export of internal Abseil changes
--
00f5301405423005d9129935c05f20155536cc1a by CJ Johnson <johnsoncj@google.com>:

Removes usage of std::aligned_storage from Abseil implementation details

PiperOrigin-RevId: 296492301

--
fc11d15f91764612fba080669d2381dc181df52b by Abseil Team <absl-team@google.com>:

Fix absl::bind_front documentation.

PiperOrigin-RevId: 296482945

--
0164c595c129c46bf21ae74eba5399a1da5f140b by Gennadiy Rozental <rogeeff@google.com>:

Automated g4 rollback of changelist 296320700.

PiperOrigin-RevId: 296439968

--
1eb295700758ca0894d872b2de7c675b4ad679af by Abseil Team <absl-team@google.com>:

Removes duplicate comments.

PiperOrigin-RevId: 296433214

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

Merge GitHub #621: Add RISCV support to GetProgramCounter()

Fixes #621

PiperOrigin-RevId: 296351174

--
95d4498167596fd7543e025bdfe9a8da9e2ca3c8 by Abseil Team <absl-team@google.com>:

Automated g4 rollback of changelist 296320700.

PiperOrigin-RevId: 296348701

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

Change TryParse interface to return managed value.

In addition introduce companion StoreValue routine which consumes pointer to source value and stores the value inside of FlagImpl. In a follow up CL we will change StoreValue implementation to behave differently depending on "value storage kind".
We also rename default_src_ to default_value_.

PiperOrigin-RevId: 296320700

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

Merge GitHub #622
 * Add missing #ifdef conditionals for ABSL_HAVE_VDSO_SUPPORT

PiperOrigin-RevId: 296272830
GitOrigin-RevId: 00f5301405423005d9129935c05f20155536cc1a
Change-Id: I1b05eeaf1280f95fb0a2c5f3654995a87c792893
Diffstat (limited to 'absl/base/exception_safety_testing_test.cc')
-rw-r--r--absl/base/exception_safety_testing_test.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/absl/base/exception_safety_testing_test.cc b/absl/base/exception_safety_testing_test.cc
index 575b535d6b52..a59be29e919c 100644
--- a/absl/base/exception_safety_testing_test.cc
+++ b/absl/base/exception_safety_testing_test.cc
@@ -328,17 +328,15 @@ TEST(ThrowingValueTest, NonThrowingDelete) {
   UnsetCountdown();
 }
 
-using Storage =
-    absl::aligned_storage_t<sizeof(ThrowingValue<>), alignof(ThrowingValue<>)>;
-
 TEST(ThrowingValueTest, NonThrowingPlacementDelete) {
   constexpr int kArrayLen = 2;
   // We intentionally create extra space to store the tag allocated by placement
   // new[].
   constexpr int kStorageLen = 4;
 
-  Storage buf;
-  Storage array_buf[kStorageLen];
+  alignas(ThrowingValue<>) unsigned char buf[sizeof(ThrowingValue<>)];
+  alignas(ThrowingValue<>) unsigned char
+      array_buf[sizeof(ThrowingValue<>[kStorageLen])];
   auto* placed = new (&buf) ThrowingValue<>(1);
   auto placed_array = new (&array_buf) ThrowingValue<>[kArrayLen];
 
@@ -902,12 +900,12 @@ TEST(ConstructorTrackerTest, CreatedAfter) {
 }
 
 TEST(ConstructorTrackerTest, NotDestroyedAfter) {
-  absl::aligned_storage_t<sizeof(Tracked), alignof(Tracked)> storage;
+  alignas(Tracked) unsigned char storage[sizeof(Tracked)];
   EXPECT_NONFATAL_FAILURE(
       {
         exceptions_internal::ConstructorTracker ct(
             exceptions_internal::countdown);
-        new (&storage) Tracked;
+        new (&storage) Tracked();
       },
       "not destroyed");
 }
@@ -924,11 +922,11 @@ TEST(ConstructorTrackerTest, DestroyedTwice) {
 
 TEST(ConstructorTrackerTest, ConstructedTwice) {
   exceptions_internal::ConstructorTracker ct(exceptions_internal::countdown);
-  absl::aligned_storage_t<sizeof(Tracked), alignof(Tracked)> storage;
+  alignas(Tracked) unsigned char storage[sizeof(Tracked)];
   EXPECT_NONFATAL_FAILURE(
       {
-        new (&storage) Tracked;
-        new (&storage) Tracked;
+        new (&storage) Tracked();
+        new (&storage) Tracked();
         reinterpret_cast<Tracked*>(&storage)->~Tracked();
       },
       "re-constructed");