Fix new warnings emitted by GCC 7

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302280 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-05-05 20:32:26 +00:00
parent b3b66a4d81
commit 799d02d2f3
3 changed files with 14 additions and 7 deletions

View File

@@ -68,8 +68,8 @@ T&
make(A0 a0)
{
static typename aligned_storage<sizeof(T)>::type buf;
::new (&buf) T(a0);
return *reinterpret_cast<T*>(&buf);
auto *obj = ::new (&buf) T(a0);
return *obj;
}
template <class T, class A0, class A1>
@@ -88,8 +88,8 @@ T&
make(A0 a0, A1 a1, A2 a2)
{
static typename aligned_storage<sizeof(T)>::type buf;
::new (&buf) T(a0, a1, a2);
return *reinterpret_cast<T*>(&buf);
auto *obj = ::new (&buf) T(a0, a1, a2);
return *obj;
}
template <typename T, size_t N>
@@ -480,8 +480,8 @@ locale::__imp::make_global()
{
// only one thread can get in here and it only gets in once
static aligned_storage<sizeof(locale)>::type buf;
::new (&buf) locale(locale::classic());
return *reinterpret_cast<locale*>(&buf);
auto *obj = ::new (&buf) locale(locale::classic());
return *obj;
}
locale&