Commit Graph

8 Commits

Author SHA1 Message Date
Richard Trieu ccedd52736 Ignore void returning overloaded functions fom -Wunused-comparison. PR19791.
llvm-svn: 209186
2014-05-20 01:34:43 +00:00
Alp Toker c3f36af8d0 Fix typos
llvm-svn: 208838
2014-05-15 01:35:53 +00:00
Richard Trieu 161132b95b When an overloaded comparison operator returns a reference, do not consider
it for -Wunused-comparion warnings.  This fixes PR19724.

llvm-svn: 208824
2014-05-14 23:22:10 +00:00
Richard Trieu 99e1c9515a Move the warning about unused relational comparison from -Wunused-value to
-Wunused-comparison.  Also, newly warn on unused result from overloaded
relational comparisons, now also in -Wunused-comparison.

llvm-svn: 203535
2014-03-11 03:11:08 +00:00
Douglas Gregor 6e8da6a291 Don't analyze comparisons in type- or value-dependent
subexpressions. Fixes PR10291.

llvm-svn: 141552
2011-10-10 17:38:18 +00:00
Chandler Carruth 2b949c2b4b Remove the last FIXMEs on -Wunused-comparison since it got moved to
entirely use the existing -Wunused-value infrastructure. This also fixes
a few missed cases for -Wunused in general.

llvm-svn: 137916
2011-08-18 02:04:29 +00:00
Chandler Carruth 463394752b Whitelist operator== and operator!= as valid for unused value warnings,
even when overloaded and user-defined. These operators are both more
valuable to warn on (due to likely typos) and extremely unlikely to be
reasonable for use to trigger side-effects.

llvm-svn: 137823
2011-08-17 09:49:44 +00:00
Chandler Carruth e2669397f1 Treating the unused equality comparisons as something other than part of
-Wunused was a mistake. It resulted in duplicate warnings and lots of
other hacks. Instead, this should be a special sub-category to
-Wunused-value, much like -Wunused-result is.

Moved to -Wunused-comparison, moved the implementation to piggy back on
the -Wunused-value implementation instead of rolling its own, different
mechanism for catching all of the "interesting" statements.

I like the unused-value mechanism for this better, but its currently
missing several top-level statements. For now, I've FIXME-ed out those
test cases. I'll enhance the generic infrastructure to catch these
statements in a subsequent patch.

This patch also removes the cast-to-void fixit hint. This hint isn't
available on any of the other -Wunused-value diagnostics, and if we want
it to be, we should add it generically rather than in one specific case.

llvm-svn: 137822
2011-08-17 09:34:37 +00:00