From 0bbdb288ca016f409061cb4d453cb8af90e28e07 Mon Sep 17 00:00:00 2001 From: Mikael Holmen Date: Thu, 11 Apr 2019 06:57:12 +0000 Subject: [PATCH] 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(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(nullptr, CharUnits::Zero()), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358152 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGNonTrivialStruct.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/CGNonTrivialStruct.cpp b/lib/CodeGen/CGNonTrivialStruct.cpp index bc34727731..caf62d2ac9 100644 --- a/lib/CodeGen/CGNonTrivialStruct.cpp +++ b/lib/CodeGen/CGNonTrivialStruct.cpp @@ -826,12 +826,12 @@ static void callSpecialFunction(G &&Gen, StringRef FuncName, QualType QT, template std::array createNullAddressArray(); template <> std::array createNullAddressArray() { - return std::array({Address(nullptr, CharUnits::Zero())}); + return std::array({{Address(nullptr, CharUnits::Zero())}}); } template <> std::array createNullAddressArray() { - return std::array({Address(nullptr, CharUnits::Zero()), - Address(nullptr, CharUnits::Zero())}); + return std::array({{Address(nullptr, CharUnits::Zero()), + Address(nullptr, CharUnits::Zero())}}); } template -- 2.50.1