coroutines: Avoid a maybe used uninitialized warning. NFC.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 17 May 2020 11:26:19 +0000 (12:26 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 17 May 2020 18:59:40 +0000 (19:59 +0100)
This avoids a (bogus) warning that occurs with some bootstrap
compilers.

gcc/cp/ChangeLog:

2020-05-17  Iain Sandoe  <iain@sandoe.co.uk>

* coroutines.cc (morph_fn_to_coro): Initialize the
gro variable.

gcc/cp/ChangeLog
gcc/cp/coroutines.cc

index 7ac074a19b6ff09077f3e00faf5f51c5591f517a..65fc6447e74c24e57e563e90a65d4a1cbdfce4c2 100644 (file)
@@ -1,3 +1,7 @@
+2020-05-17  Iain Sandoe  <iain@sandoe.co.uk>
+
+       * coroutines.cc (morph_fn_to_coro): Initialize the gro variable.
+
 2020-05-16  Iain Sandoe  <iain@sandoe.co.uk>
 
        * coroutines.cc (finish_co_return_stmt): Implement rules
index facfafaaa86c7332beb94b14f16f30968cae63ad..4cbc0e09994c3fa68aa0cb332905e1ab680f8a20 100644 (file)
@@ -4285,7 +4285,8 @@ morph_fn_to_coro (tree orig, tree *resumer, tree *destroyer)
   tree gro_context_body = push_stmt_list ();
   bool gro_is_void_p = VOID_TYPE_P (TREE_TYPE (get_ro));
 
-  tree gro, gro_bind_vars = NULL_TREE;
+  tree gro = NULL_TREE;
+  tree gro_bind_vars = NULL_TREE;
   /* We have to sequence the call to get_return_object before initial
      suspend.  */
   if (gro_is_void_p)