diff options
Diffstat (limited to 'test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp')
-rw-r--r-- | test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp b/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp index 253515e3db3c..f2cf9f2d4187 100644 --- a/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp +++ b/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp @@ -29,11 +29,12 @@ struct A int main() { + globalMemCounter.reset(); std::allocator<A> a; assert(globalMemCounter.checkOutstandingNewEq(0)); assert(A_constructed == 0); globalMemCounter.last_new_size = 0; - A* ap = a.allocate(3); + A* volatile ap = a.allocate(3); assert(globalMemCounter.checkOutstandingNewEq(1)); assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int))); assert(A_constructed == 0); @@ -42,7 +43,7 @@ int main() assert(A_constructed == 0); globalMemCounter.last_new_size = 0; - A* ap2 = a.allocate(3, (const void*)5); + A* volatile ap2 = a.allocate(3, (const void*)5); assert(globalMemCounter.checkOutstandingNewEq(1)); assert(globalMemCounter.checkLastNewSizeEq(3 * sizeof(int))); assert(A_constructed == 0); |