--- Comment #3 from redi at gcc dot gnu dot org 2009-12-11 00:37 ---
This would have prevented bugs I've dealt with where critical sections where
not protected:
{
lock_guard (mutex);
// mutex NOT locked here!
}
But I'm not convinced that doing this is always a mistake. Would the war
--- Comment #4 from kkylheku at gmail dot com 2009-12-11 02:34 ---
(In reply to comment #3)
> This would have prevented bugs I've dealt with where critical sections where
> not protected:
> {
> lock_guard (mutex);
> // mutex NOT locked here!
> }
> But I'm not convinced that doing thi
--- Comment #5 from jwakely dot gcc at gmail dot com 2009-12-11 10:39
---
(In reply to comment #4)
> > But I'm not convinced that doing this is always a mistake.
>
> Since we don't care about the object, we must care about the constructor side
> effect. I seem to be under the impressio
--- Comment #6 from kkylheku at gmail dot com 2009-12-11 11:57 ---
(In reply to comment #5)
> (In reply to comment #4)
> > > But I'm not convinced that doing this is always a mistake.
> >
> > Since we don't care about the object, we must care about the constructor
> > side
> > effect.
--- Comment #1 from kkylheku at gmail dot com 2008-06-20 19:23 ---
Created an attachment (id=15798)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15798&action=view)
Implements -Wunused-objects warning for C++.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #2 from kkylheku at gmail dot com 2008-06-20 20:26 ---
I should add that this is different from -Wunused-value, because I want this
warning emitted even if the constructor (or its corresponding destructor) have
side effects.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
Manuel López-Ibáñez changed:
What|Removed |Added
CC||manu at gcc dot gnu.org
--- Commen
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #11 from Kaz Kylheku ---
(In reply to Manuel López-Ibáñez from comment #10)
> (In reply to Kaz Kylheku from comment #1)
> > Created attachment 15798 [details]
> > Implements -Wunused-objects warning for C++.
>
> Patches need to be pr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #12 from Jonathan Wakely ---
(In reply to Kaz Kylheku from comment #11)
> The bug database has an "enhancement" type, so obviously, it is to be used
> for submitting enhancements.
No, it's for submitting enhancement *requests*, i.e.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #13 from Manuel López-Ibáñez ---
(In reply to Kaz Kylheku from comment #11)
> I deployed that change to large team of developers, and the toolchain with
> that change went to customers also. The warning caught problems that were
> fix
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
Johannes Schaub changed:
What|Removed |Added
CC||schaub.johannes@googlemail.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #8 from Jonathan Wakely ---
(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.
(Al
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #9 from Jonathan Wakely ---
I still think it would be nice to get a warning for e.g.
std::unique_lock(m);
where "M m" is visible in an enclosing scope and would have been a viable
argument for another constructor, but that would b
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
Andrew Pinski changed:
What|Removed |Added
Resolution|--- |FIXED
Target Milestone|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #15 from Kaz Kylheku ---
(In reply to Manuel López-Ibáñez from comment #13)
> (In reply to Kaz Kylheku from comment #11)
> > I deployed that change to large team of developers, and the toolchain with
> > that change went to customers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #16 from Kaz Kylheku ---
(In reply to Andrew Pinski from comment #14)
> C++17 adds nodiscard attribute which can be placed on class/struct types,
> functions, constructors and others and then you get a warning if you ignore
> the valu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #17 from Jonathan Wakely ---
No, the nodiscard warnings must be silenced with a cast to void. They can't be
"stronger" than that.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #18 from Jonathan Wakely ---
(In reply to Kaz Kylheku from comment #15)
> In April 2020 I created a patch for the GNU C Preprocessor, with
> documentation, test cases and everything. I submitted it to the GCC Patches
> mailing list, e
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36587
--- Comment #19 from Kaz Kylheku ---
(In reply to Jonathan Wakely from comment #18)
> Was there an earlier submission?
No there wasn't; that's my mistake in my comment.
19 matches
Mail list logo