public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rust/107633] [13 regression] Bootstrap failure due to -Werror=unused-parameter and -Werror=dangling-reference
Date: Fri, 11 Nov 2022 13:45:13 +0000 [thread overview]
Message-ID: <bug-107633-4-mTv3G8IzbP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107633-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107633
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Rainer Orth from comment #0)
> /vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc:
> In member function 'Rust::TyTy::BaseType*
> Rust::Resolver::TypeCheckType::resolve_segments(Rust::NodeId, Rust::HirId,
> std::vector<std::unique_ptr<Rust::HIR::TypePathSegment> >&, std::size_t,
> Rust::TyTy::BaseType*, const Rust::Analysis::NodeMapping&, Location)':
> /vol/gcc/src/hg/master/rust/gcc/rust/typecheck/rust-hir-type-check-type.cc:
> 465:13: error: possibly dangling reference to a temporary
> [-Werror=dangling-reference]
> 465 | auto &candidate = *candidates.begin ();
This should probably be:
auto first = candidates.begin ();
auto &candidate = *first;
so that the iterator persists as long as its value is needed.
next prev parent reply other threads:[~2022-11-11 13:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-11 12:12 [Bug rust/107633] New: " ro at gcc dot gnu.org
2022-11-11 13:37 ` [Bug rust/107633] " rguenth at gcc dot gnu.org
2022-11-11 13:45 ` redi at gcc dot gnu.org [this message]
2022-11-11 13:48 ` redi at gcc dot gnu.org
2022-11-11 15:03 ` mpolacek at gcc dot gnu.org
2022-11-11 15:09 ` mpolacek at gcc dot gnu.org
2022-11-11 20:27 ` mpolacek at gcc dot gnu.org
2022-11-14 11:26 ` ro at CeBiTec dot Uni-Bielefeld.DE
2022-11-14 12:12 ` dkm at gcc dot gnu.org
2022-11-17 10:18 ` cohenarthur.dev at gmail dot com
2022-11-17 15:22 ` mpolacek at gcc dot gnu.org
2022-12-14 13:42 ` tschwinge at gcc dot gnu.org
2022-12-14 14:49 ` tschwinge at gcc dot gnu.org
2022-12-14 15:40 ` [Bug rust/107633] " tschwinge at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-107633-4-mTv3G8IzbP@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).