From 6b03dff440b37ce4ce98423f57cbabfc039360c9 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 2 Apr 2021 21:31:05 +0200 Subject: =?UTF-8?q?Address=20'error:=20=E2=80=98kind=E2=80=99=20may=20be?= =?UTF-8?q?=20used=20uninitialized=20in=20this=20function=20[-Werror=3Dmay?= =?UTF-8?q?be-uninitialized]'=20diagnostic=20[#336]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from [...]/gcc/rust/hir/tree/rust-hir-full.h:29, from [...]/gcc/rust/hir/rust-ast-lower.h:25, from [...]/gcc/rust/hir/rust-ast-lower.cc:19: [...]/gcc/rust/hir/tree/rust-hir-type.h: In member function ‘virtual void Rust::HIR::ASTLoweringType::visit(Rust::AST::BareFunctionType&)’: [...]/gcc/rust/hir/tree/rust-hir-type.h:785:3: error: ‘kind’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 785 | MaybeNamedParam (MaybeNamedParam &&other) = default; | ^~~~~~~~~~~~~~~ In file included from [...]/gcc/rust/hir/rust-ast-lower-item.h:25, from [...]/gcc/rust/hir/rust-ast-lower.cc:20: [...]/gcc/rust/hir/rust-ast-lower-type.h:58:41: note: ‘kind’ was declared here 58 | HIR::MaybeNamedParam::ParamKind kind; | ^~~~ --- gcc/rust/hir/rust-ast-lower-type.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc') diff --git a/gcc/rust/hir/rust-ast-lower-type.h b/gcc/rust/hir/rust-ast-lower-type.h index cd9b032..318d126 100644 --- a/gcc/rust/hir/rust-ast-lower-type.h +++ b/gcc/rust/hir/rust-ast-lower-type.h @@ -67,6 +67,8 @@ public: case AST::MaybeNamedParam::ParamKind::WILDCARD: kind = HIR::MaybeNamedParam::ParamKind::WILDCARD; break; + default: + gcc_unreachable (); } HIR::Type *param_type -- cgit v1.1