This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36587] Feature: add warning for constructor call with discarded return.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Sep 2013 21:49:42 +0000
- Subject: [Bug c++/36587] Feature: add warning for constructor call with discarded return.
- Auto-submitted: auto-generated
- References: <bug-36587-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Johannes Schaub from comment #7)
> Jonathan, unfortunately that code won't create and discard a temporary
> object,
Yes, you're right, there's no temporary so it's not relevant to this PR.
(Although your "whatever that means" assumes my example used std::lock_guard,
but if that was the case I'd have needed to use some template arguments. Other
scoped-lock types are DefaultConstructible, e.g. std::unique_lock<T>)