From 348a883eb873c960f9630444835ab8eb35e5a3b2 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 2 Apr 2021 21:54:45 +0200 Subject: =?UTF-8?q?Address=20'error:=20=E2=80=98*.Rust::HIR::Qual?= =?UTF-8?q?ifiedPathInType::.Rust::HIR::TypeNoBounds::.Rust::HIR::Type::mappings=E2=80=99=20is=20used=20uninitializ?= =?UTF-8?q?ed=20[-Werror=3Duninitialized]'=20diagnostic=20[#336]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... by doing the same as in the "assignment operator with vector clone" a few lines later. I have not verified what's (supposed to be) going on here; that code seems unused, and thus untested, and thus I marked it up as such. In file included from [...]/gcc/rust/hir/tree/rust-hir-expr.h:23, from [...]/gcc/rust/hir/tree/rust-hir-full.h:24, from [...]/gcc/rust/backend/rust-compile.h:23, from [...]/gcc/rust/backend/rust-compile.cc:19: [...]/gcc/rust/hir/tree/rust-hir-path.h: In copy constructor ‘Rust::HIR::QualifiedPathInType::QualifiedPathInType(const Rust::HIR::QualifiedPathInType&)’: [...]/gcc/rust/hir/tree/rust-hir-path.h:820:21: error: ‘*.Rust::HIR::QualifiedPathInType::.Rust::HIR::TypeNoBounds::.Rust::HIR::Type::mappings’ is used uninitialized [-Werror=uninitialized] 820 | : TypeNoBounds (mappings), path_type (other.path_type), locus (other.locus) | ^~~~~~~~ --- gcc/rust/hir/tree/rust-hir-path.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/rust/hir/tree/rust-hir-path.h b/gcc/rust/hir/tree/rust-hir-path.h index 2affb68..8dbde9c 100644 --- a/gcc/rust/hir/tree/rust-hir-path.h +++ b/gcc/rust/hir/tree/rust-hir-path.h @@ -817,11 +817,15 @@ public: // Copy constructor with vector clone QualifiedPathInType (QualifiedPathInType const &other) - : TypeNoBounds (mappings), path_type (other.path_type), locus (other.locus) + : TypeNoBounds (other.mappings), path_type (other.path_type), + locus (other.locus) { segments.reserve (other.segments.size ()); for (const auto &e : other.segments) segments.push_back (e->clone_type_path_segment ()); + + // Untested. + gcc_unreachable (); } // Overloaded assignment operator with vector clone -- cgit v1.1