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

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 13:48:56 PDT 2020


Generally it'd be helpful to describe what the change is in the
subject line ("Add braces around initialization of a subobject
[-Wmissing-braces]") as that's more informative than "Silence compiler
warning [-Wmissing braces]", the latter doesn't say how it was
silenced, which might make a difference/be relevant to those
reading/reviewing changes (makes a difference to me, at least)

On Wed, Jun 17, 2020 at 1:02 PM Huihui Zhang via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
>
>
> 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
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the cfe-commits mailing list