diff mbox series

Fix clang warning in pt.cc

Message ID 859db331-d123-c872-a7b8-61864674bcf8@suse.cz
State New
Headers show
Series Fix clang warning in pt.cc | expand

Commit Message

Martin Liška Feb. 21, 2022, 4:48 p.m. UTC
Fixes:

gcc/cp/pt.cc:13755:23: warning: suggest braces around initialization of subobject [-Wmissing-braces]
   tree_vec_map in = { fn, nullptr };

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/cp/ChangeLog:

	* pt.cc (defarg_insts_for): Use braces for subobject.
---
  gcc/cp/pt.cc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin Liška Feb. 24, 2022, 3:58 p.m. UTC | #1
On 2/21/22 17:48, Martin Liška wrote:
> Ready to be installed?

I'm going to install this as obvious.

Martin
diff mbox series

Patch

diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 16bedbc4bc7..70f02db8757 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -13752,7 +13752,7 @@  defarg_insts_for (tree fn)
  {
    if (!defarg_inst)
      defarg_inst = hash_table<tree_vec_map_cache_hasher>::create_ggc (13);
-  tree_vec_map in = { fn, nullptr };
+  tree_vec_map in = { { fn }, nullptr };
    tree_vec_map **slot
      = defarg_inst->find_slot_with_hash (&in, DECL_UID (fn), INSERT);
    if (!*slot)