public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] is_match_compatible: Fix warning of uninitialized delim_id variable
@ 2022-06-08 12:24 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-06-08 12:24 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1f8780be706f557d840e6c8e8b9188444f11df82

commit 1f8780be706f557d840e6c8e8b9188444f11df82
Author: CohenArthur <arthur.cohen@epita.fr>
Date:   Sun Mar 27 13:35:03 2022 +0200

    is_match_compatible: Fix warning of uninitialized delim_id variable
    
    Since all cases in the switch were handled, this was not really a
    problem. Still, we should avoid those in case we need to add
    delimiters at some point
    
    Co-authored-by: Thomas Schwinge <thomas@schwinge.name>

Diff:
---
 gcc/rust/parse/rust-parse.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/rust/parse/rust-parse.cc b/gcc/rust/parse/rust-parse.cc
index b77100a227d..f1e2caa258b 100644
--- a/gcc/rust/parse/rust-parse.cc
+++ b/gcc/rust/parse/rust-parse.cc
@@ -241,6 +241,9 @@ peculiar_fragment_match_compatible (const AST::MacroMatchFragment &last_match,
 	  case AST::CURLY:
 	    delim_id = LEFT_CURLY;
 	    break;
+	  default:
+	    gcc_unreachable ();
+	    break;
 	  }
 	if (contains (allowed_toks, delim_id))
 	  return true;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-08 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 12:24 [gcc/devel/rust/master] is_match_compatible: Fix warning of uninitialized delim_id variable Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).