aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2021-04-02 21:54:45 +0200
committerPhilip Herron <herron.philip@googlemail.com>2021-04-05 10:44:15 +0100
commit348a883eb873c960f9630444835ab8eb35e5a3b2 (patch)
tree9cf09b01b8f0573f5ac5a8f67731580260a20425 /gcc
parent2e1a7f6a72bb4133e339068191d291ebd2bbfc15 (diff)
downloadgcc-348a883eb873c960f9630444835ab8eb35e5a3b2.zip
gcc-348a883eb873c960f9630444835ab8eb35e5a3b2.tar.gz
gcc-348a883eb873c960f9630444835ab8eb35e5a3b2.tar.bz2
Address 'error: ‘*<unknown>.Rust::HIR::QualifiedPathInType::<anonymous>.Rust::HIR::TypeNoBounds::<anonymous>.Rust::HIR::Type::mappings’ is used uninitialized [-Werror=uninitialized]' diagnostic [#336]
... 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: ‘*<unknown>.Rust::HIR::QualifiedPathInType::<anonymous>.Rust::HIR::TypeNoBounds::<anonymous>.Rust::HIR::Type::mappings’ is used uninitialized [-Werror=uninitialized] 820 | : TypeNoBounds (mappings), path_type (other.path_type), locus (other.locus) | ^~~~~~~~
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/hir/tree/rust-hir-path.h6
1 files changed, 5 insertions, 1 deletions
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