History log of /external/clang/test/Sema/unused-expr.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9016bb771265a10f188c76342254badecc695253 26-Feb-2013 Matt Beaumont-Gay <matthewbg@google.com> Warn on dropping the return value from a warn_unused_result function, even in
macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
87b73ba920f523ef13f2420cbdb958a281aa6f33 17-Jan-2013 Matt Beaumont-Gay <matthewbg@google.com> Suppress all -Wunused-value warnings from macro body expansions.

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
6d919fb67bf6aa3db09608fb2948b558977c6929 24-Oct-2012 Matt Beaumont-Gay <matthewbg@google.com> Address feedback from Eli Friedman on r166522.

In particular, we do want to warn on some unused cast subexpressions within
macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
c7db84d0146a6f22b19949fb0128e2148aa92467 24-Oct-2012 Matt Beaumont-Gay <matthewbg@google.com> Don't emit -Wunused-value warnings from macro expansions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
10caec2600089449b58c065d56fc449d095b4536 13-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> c: small refactoring of checking for __attribute__(const))
per Richard's comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
a7846852ba8b2b53664a674a41d116e0419d8768 13-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> c: make __has_attribute(const) work for const
function attribute. // rdar://10253857


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
a6115068cde719142eb394db88612c185cabd05b 24-May-2012 Eli Friedman <eli.friedman@gmail.com> Add a warning to diagnose statements in C++ like "*(volatile int*)x;". 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>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
ec8058f64bbcd79bd47748f4cf8628123dd3bae6 17-Aug-2011 Chandler Carruth <chandlerc@gmail.com> 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
d6b8de0e7b01196bd2bee207feb81bc409a5baf9 25-Jan-2011 John McCall <rjmccall@apple.com> Change the wording of the bad-decl-for-attribute warning and error
to make it clear that we're talking about the declarations and not the types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
1f4295b966870fff784faa5a5eba3fe9e27a6406 15-Oct-2010 Gabor Greif <ggreif@gmail.com> testcase for http://llvm.org/PR8371 of my last commit, r116570

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
1b2ad2fd9e2d5352144481aa1fd995d333d9adc9 20-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r114316, -Wunused-value enabled by default was intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114318 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
6dff2288a8054bdbc97217568e5831bcce809db8 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
c6dfe194f623b02c123759f235b504d4850fc178 09-May-2010 Douglas Gregor <dgregor@apple.com> Don't complain about an __builtin_va_arg expression's result being
unused, since the operation has side effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103360 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
209acbd6d0c1b4444eb8c1682717753e1cbe38de 07-Apr-2010 John McCall <rjmccall@apple.com> Devote a special diagnostic to the typo
(void*) someFunction(5, 10, 15, 20);
where the cast is presumably meant to be to 'void'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
46171917dc87caf0c7a741a7301f36db2e20b132 23-Jan-2010 Mike Stump <mrs@apple.com> Insulate these from changes to the default for -Wunreachable-code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
c31176d5ebbcd407aa512bbd5f717e35da629e7d 08-Jan-2010 Dan Gohman <gohman@apple.com> Use -fno-math-errno by default, and remove the IsMathErrnoDefault
targethook, which is no longer being used. This fixes PR5971.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
634785ca8423b6dd6c15e80714a076c3aaa5a047 30-Dec-2009 Chris Lattner <sabre@nondot.org> testcase for previous patch!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
f857798fa77ac50c6d0a262d96ad6176187190e3 23-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> warn when attribute warn_unused_result is applied to void functions.
while at it, remove an outdated FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
d20254f2875d0004c57ee766f258dbcee29f4841 21-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> fix PR4010: add support for the warn_unused_result for function pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
a5728872c7702ddd09537c95bc3cbd20e1f2fb09 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
53e8484581ca358c3a2ccd8ea39c136c6e85d606 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... variants instead of using llvm::cl::init(true) arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
7909fee36cb2c4737e5c74bf683913bf5ab09815 13-Oct-2009 Chris Lattner <sabre@nondot.org> add rdar # I accidentally lost.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
9079cd31061b00f30c7ced7874c45e15f8dd044e 13-Oct-2009 Chris Lattner <sabre@nondot.org> merge two tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
bc8d42c6f1565c0b2f93ad524edebfd7a4e6cac6 13-Oct-2009 Chris Lattner <sabre@nondot.org> make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
3af708ff19e4ae2bf9e40550548361b00e5916bf 01-Aug-2009 Anders Carlsson <andersca@mac.com> More warnings for unused expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
754431107b61a0523df5271c2876a73dd5a051e9 31-Jul-2009 Anders Carlsson <andersca@mac.com> Diagnose unused expression results for all statements, just not compound statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
fb84664349ca6f37f5ec4df440f6c362cca62470 28-Jul-2009 Chris Lattner <sabre@nondot.org> fix PR4633: cast to void should silence the 'unused expression' warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
48d1ef782c8c88066b5febf60f8f456064d7d3f0 07-Apr-2009 Daniel Dunbar <daniel@zuster.org> Driver: Manually translate a number of -f with no- variants options to
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
d7d5f0223bd30dfd618762349c6209dd1d5ea3e6 24-Mar-2009 Daniel Dunbar <daniel@zuster.org> Rename clang to clang-cc.

Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
5bef8ddabfe157aa6f1f9010d3d144215b3e731a 17-Feb-2009 Chris Lattner <sabre@nondot.org> add support for -fno-math-errno, and validate that it affects sema properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
7d84c76648792cf1035bfc4d60559f5a4544edb1 17-Feb-2009 Chris Lattner <sabre@nondot.org> sema no longer explodes, yay!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
4be1f47de20525ad90f02ba8682a7e2cbd3205d1 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Make the unused expression warning a bit less aggressive (found in PHP
code).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
3b427b3ba518f7a7293458c2d3d92eebd8458d87 11-Oct-2007 Chris Lattner <sabre@nondot.org> rename -parse-ast-print to -ast-print
rename -parse-ast-dump to -ast-dump
remove -parse-ast, which is redundant with -fsyntax-only



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
9f3d942e9970bc8f51add390b2a2c46b5a2ab747 26-Sep-2007 Ted Kremenek <kremenek@apple.com> Removed option "-parse-ast-check" from clang driver. This is now implemented
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
98414c1b7d1944a57156d52e29bd41c005de09ac 31-Aug-2007 Chris Lattner <sabre@nondot.org> Fix a bug/missing-feature Ted noticed: the 'unused' warning should not
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; });
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
77878cc5aa6ad01fc0c91bac1a61819dbf3bf691 27-Aug-2007 Steve Naroff <snaroff@apple.com> Add Type::getAsBuiltinType() and Type::builtinTypesAreCompatible().
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).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
6e844adbe981e549ac0ad2300ea942832aad5ef6 26-Aug-2007 Chris Lattner <sabre@nondot.org> Fix a bug reported by Keith Bauer


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
2b8bac52b8c5690c7a6525c95feefe29bb12178d 21-Aug-2007 Chris Lattner <sabre@nondot.org> we now correctly emit:
unused-expr.c:8:6: warning: comparison of distinct pointer types ('int volatile *' and 'int *')
VP == P;
~~ ^ ~




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c
5f016e2cb5d11daeb237544de1c5d59f20fe1a6e 11-Jul-2007 Reid Spencer <rspencer@reidspencer.com> Stage two of getting CFE top correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/unused-expr.c