Add { } to silence compiler warning [NFC]

At least clang 3.6 warns on the original code:

../tools/clang/lib/CodeGen/CGNonTrivialStruct.cpp:829:34: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
  return std::array<Address, 1>({Address(nullptr, CharUnits::Zero())});
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                 {                                  }
../tools/clang/lib/CodeGen/CGNonTrivialStruct.cpp:833:34: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
  return std::array<Address, 2>({Address(nullptr, CharUnits::Zero()),
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

llvm-svn: 358152
This commit is contained in:
Mikael Holmen 2019-04-11 06:57:12 +00:00
parent 1b01f9728f
commit 58c080a3b1
1 changed files with 3 additions and 3 deletions

View File

@ -826,12 +826,12 @@ static void callSpecialFunction(G &&Gen, StringRef FuncName, QualType QT,
template <size_t N> std::array<Address, N> createNullAddressArray();
template <> std::array<Address, 1> createNullAddressArray() {
return std::array<Address, 1>({Address(nullptr, CharUnits::Zero())});
return std::array<Address, 1>({{Address(nullptr, CharUnits::Zero())}});
}
template <> std::array<Address, 2> createNullAddressArray() {
return std::array<Address, 2>({Address(nullptr, CharUnits::Zero()),
Address(nullptr, CharUnits::Zero())});
return std::array<Address, 2>({{Address(nullptr, CharUnits::Zero()),
Address(nullptr, CharUnits::Zero())}});
}
template <class G, size_t N>