| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
macros.
llvm-svn: 176114
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is inspired by a number of false positives in real code, including
PR14968. I've added test cases reduced from these false positives to
test/Sema/unused-expr.c, as well as corresponding test cases that pass the
offending expressions as arguments to a no-op macro to ensure that we do warn
there.
This also removes my previous tweak from r166522/r166534, so that we warn on
unused cast expressions in macro arguments.
There were several test cases that were using -Wunused-value to test general
diagnostic emission features; I changed those to use other warnings or warn on
a macro argument expression. I stared at the test case for PR14399 for a while
with Richard Smith and we believe the new test case exercises the same
codepaths as before.
llvm-svn: 172696
|
|
|
|
|
|
|
| |
In particular, we do want to warn on some unused cast subexpressions within
macros.
llvm-svn: 166534
|
|
|
|
| |
llvm-svn: 166522
|
|
|
|
|
|
| |
per Richard's comment.
llvm-svn: 161786
|
|
|
|
|
|
| |
function attribute. // rdar://10253857
llvm-svn: 161767
|
|
|
|
|
|
| |
Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value. I also made a few minor improvements to existing unused value warnings in the process. <rdar://problem/11516811>.
llvm-svn: 157362
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-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
|
|
|
|
|
|
| |
to make it clear that we're talking about the declarations and not the types.
llvm-svn: 124175
|
|
|
|
| |
llvm-svn: 116571
|
|
|
|
| |
llvm-svn: 114318
|
|
|
|
| |
llvm-svn: 114316
|
|
|
|
|
|
| |
unused, since the operation has side effects.
llvm-svn: 103360
|
|
|
|
|
|
|
| |
(void*) someFunction(5, 10, 15, 20);
where the cast is presumably meant to be to 'void'.
llvm-svn: 100574
|
|
|
|
| |
llvm-svn: 94326
|
|
|
|
|
|
| |
targethook, which is no longer being used. This fixes PR5971.
llvm-svn: 92987
|
|
|
|
| |
llvm-svn: 92317
|
|
|
|
|
|
| |
while at it, remove an outdated FIXME
llvm-svn: 91946
|
|
|
|
| |
llvm-svn: 91803
|
|
|
|
|
|
|
|
|
| |
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).
llvm-svn: 91446
|
|
|
|
|
|
| |
variants instead of using llvm::cl::init(true) arguments.
llvm-svn: 89315
|
|
|
|
| |
llvm-svn: 83942
|
|
|
|
| |
llvm-svn: 83941
|
|
|
|
|
|
| |
about the reason, rdar://7186119.
llvm-svn: 83940
|
|
|
|
| |
llvm-svn: 77763
|
|
|
|
|
|
| |
statements.
llvm-svn: 77631
|
|
|
|
| |
llvm-svn: 77344
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang.
- We will eventually want some more driver infrastructre for this
probably.
- For now, the clang-cc interface stays relatively the same, but we
don't accept multiple instances anymore, or the [no-] variants
directly.
llvm-svn: 68550
|
|
|
|
|
|
| |
Tests and drivers updated, still need to shuffle dirs.
llvm-svn: 67602
|
|
|
|
| |
llvm-svn: 64708
|
|
|
|
| |
llvm-svn: 64707
|
|
|
|
|
|
| |
code).
llvm-svn: 51276
|
|
|
|
|
|
|
| |
rename -parse-ast-dump to -ast-dump
remove -parse-ast, which is redundant with -fsyntax-only
llvm-svn: 42852
|
|
|
|
|
|
|
|
|
|
|
|
| |
using "-parse-ast -verify".
Updated all test cases (using a sed script) that invoked -parse-ast-check to
now use -parse-ast -verify.
Fixed a bug where using "-verify" instead of "-parse-ast-check" would not
correctly create the DiagClient needed to accumulate diagnostics.
llvm-svn: 42365
|
|
|
|
|
|
|
|
|
|
| |
warn about the last stmt in a stmtexpr, f.e. there should be no warning for:
int maxval_stmt_expr(int x, int y) {
return ({int _a = x, _b = y; _a > _b ? _a : _b; });
}
llvm-svn: 41655
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modified Type::typesAreCompatible() to use the above.
This fixes the following bug submitted by Keith Bauer (thanks!).
int equal(char *a, const char *b)
{
return a == b;
}
Also tweaked Sema::CheckCompareOperands() to ignore the qualifiers when
comparing two pointer types (though it doesn't relate directly to this bug).
llvm-svn: 41476
|
|
|
|
| |
llvm-svn: 41452
|
|
|
|
|
|
|
|
| |
unused-expr.c:8:6: warning: comparison of distinct pointer types ('int volatile *' and 'int *')
VP == P;
~~ ^ ~
llvm-svn: 41210
|
|
llvm-svn: 39683
|