diff mbox series

Wrap array in ctor with braces.

Message ID 11f9875a-d510-24fe-85a4-1d15797e3242@suse.cz
State New
Headers show
Series Wrap array in ctor with braces. | expand

Commit Message

Martin Liška March 3, 2020, 9:04 a.m. UTC
Hi.

The patch is about to silent a few clang warnings:

/home/marxin/Programming/gcc/gcc/cp/method.c:903:26: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    { "partial_ordering", "equivalent", "greater", "less", "unordered" },
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          {                                           }
/home/marxin/Programming/gcc/gcc/cp/method.c:904:23: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    { "weak_ordering", "equivalent", "greater", "less" },
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                       {                              }
/home/marxin/Programming/gcc/gcc/cp/method.c:905:25: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    { "strong_ordering", "equal", "greater", "less" }
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
                         {                         }

Ready to be installed?
Thanks,
Martin

gcc/cp/ChangeLog:

2020-03-03  Martin Liska  <mliska@suse.cz>

	* method.c: Wrap array in ctor with braces in order
	to silent clang warnings.
---
  gcc/cp/method.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jason Merrill March 3, 2020, 6:45 p.m. UTC | #1
On 3/3/20 4:04 AM, Martin Liška wrote:
> Hi.
> 
> The patch is about to silent a few clang warnings:
> 
> /home/marxin/Programming/gcc/gcc/cp/method.c:903:26: warning: suggest 
> braces around initialization of subobject [-Wmissing-braces]
>     { "partial_ordering", "equivalent", "greater", "less", "unordered" },
>                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>                           {                                           }
> /home/marxin/Programming/gcc/gcc/cp/method.c:904:23: warning: suggest 
> braces around initialization of subobject [-Wmissing-braces]
>     { "weak_ordering", "equivalent", "greater", "less" },
>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>                        {                              }
> /home/marxin/Programming/gcc/gcc/cp/method.c:905:25: warning: suggest 
> braces around initialization of subobject [-Wmissing-braces]
>     { "strong_ordering", "equal", "greater", "less" }
>                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
>                          {                         }
> 
> Ready to be installed?
> Thanks,
> Martin
> 
> gcc/cp/ChangeLog:
> 
> 2020-03-03  Martin Liska  <mliska@suse.cz>
> 
>      * method.c: Wrap array in ctor with braces in order
>      to silent clang warnings.
> ---
>   gcc/cp/method.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> 

OK.
diff mbox series

Patch

diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 790d5704092..f10cfecaae8 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -900,9 +900,9 @@  struct comp_cat_info_t
 };
 static const comp_cat_info_t comp_cat_info[cc_last]
 = {
-   { "partial_ordering", "equivalent", "greater", "less", "unordered" },
-   { "weak_ordering", "equivalent", "greater", "less" },
-   { "strong_ordering", "equal", "greater", "less" }
+   { "partial_ordering", { "equivalent", "greater", "less", "unordered" } },
+   { "weak_ordering", { "equivalent", "greater", "less" } },
+   { "strong_ordering", { "equal", "greater", "less" } }
 };
 
 /* A cache of the category types to speed repeated lookups.  */