[clang] 9d8d064 - [NFC] Silence compiler warning [-Wmissing-braces].

Huihui Zhang via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 17 13:02:05 PDT 2020


Author: Huihui Zhang
Date: 2020-06-17T13:01:53-07:00
New Revision: 9d8d0646d751326e2766caeaa20f6e0d4b89a4f6

URL: https://github.com/llvm/llvm-project/commit/9d8d0646d751326e2766caeaa20f6e0d4b89a4f6
DIFF: https://github.com/llvm/llvm-project/commit/9d8d0646d751326e2766caeaa20f6e0d4b89a4f6.diff

LOG: [NFC] Silence compiler warning [-Wmissing-braces].

clang/lib/CodeGen/CGNonTrivialStruct.cpp:330:7: warning: suggest braces around initialization of subobject [-Wmissing-braces]
  Address(CGF->Builder.CreateLoad(CGF->GetAddrOfLocalVar(Args[Ints])),
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  {

Added: 
    

Modified: 
    clang/lib/CodeGen/CGNonTrivialStruct.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGNonTrivialStruct.cpp b/clang/lib/CodeGen/CGNonTrivialStruct.cpp
index 73188c48e885..d134be83a9dc 100644
--- a/clang/lib/CodeGen/CGNonTrivialStruct.cpp
+++ b/clang/lib/CodeGen/CGNonTrivialStruct.cpp
@@ -326,9 +326,9 @@ static std::array<Address, N> getParamAddrs(std::index_sequence<Ints...> IntSeq,
                                             std::array<CharUnits, N> Alignments,
                                             FunctionArgList Args,
                                             CodeGenFunction *CGF) {
-  return std::array<Address, N>{
+  return std::array<Address, N>{{
       Address(CGF->Builder.CreateLoad(CGF->GetAddrOfLocalVar(Args[Ints])),
-              Alignments[Ints])...};
+              Alignments[Ints])...}};
 }
 
 // Template classes that are used as bases for classes that emit special


        


More information about the cfe-commits mailing list