forked from OSchip/llvm-project
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:
parent
1b01f9728f
commit
58c080a3b1
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue