From 799d02d2f3f96bf4bd00aacc19bfb636ce8acb20 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 5 May 2017 20:32:26 +0000 Subject: Fix new warnings emitted by GCC 7 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302280 91177308-0d34-0410-b5e6-96231b3b80d8 --- src/locale.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/locale.cpp b/src/locale.cpp index 1460f9662..1ed9b41fd 100644 --- a/src/locale.cpp +++ b/src/locale.cpp @@ -68,8 +68,8 @@ T& make(A0 a0) { static typename aligned_storage::type buf; - ::new (&buf) T(a0); - return *reinterpret_cast(&buf); + auto *obj = ::new (&buf) T(a0); + return *obj; } template @@ -88,8 +88,8 @@ T& make(A0 a0, A1 a1, A2 a2) { static typename aligned_storage::type buf; - ::new (&buf) T(a0, a1, a2); - return *reinterpret_cast(&buf); + auto *obj = ::new (&buf) T(a0, a1, a2); + return *obj; } template @@ -480,8 +480,8 @@ locale::__imp::make_global() { // only one thread can get in here and it only gets in once static aligned_storage::type buf; - ::new (&buf) locale(locale::classic()); - return *reinterpret_cast(&buf); + auto *obj = ::new (&buf) locale(locale::classic()); + return *obj; } locale& -- cgit v1.2.3