This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/36587] Feature: add warning for constructor call with discarded return.


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>)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]