diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2021-04-02 21:31:05 +0200 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-04-05 10:44:33 +0100 |
commit | 6b03dff440b37ce4ce98423f57cbabfc039360c9 (patch) | |
tree | f33fafb601014355e273ee0f5bb8adc5f5a01169 /gcc | |
parent | 348a883eb873c960f9630444835ab8eb35e5a3b2 (diff) | |
download | gcc-6b03dff440b37ce4ce98423f57cbabfc039360c9.zip gcc-6b03dff440b37ce4ce98423f57cbabfc039360c9.tar.gz gcc-6b03dff440b37ce4ce98423f57cbabfc039360c9.tar.bz2 |
Address 'error: ‘kind’ may be used uninitialized in this function [-Werror=maybe-uninitialized]' diagnostic [#336]
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;
| ^~~~
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/hir/rust-ast-lower-type.h | 2 |
1 files changed, 2 insertions, 0 deletions
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 |