summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/expr-comma.c
Commit message (Collapse)AuthorAgeFilesLines
* Adding a -Wunused-value warning for expressions with side effects used in an ↵Aaron Ballman2014-12-171-2/+1
| | | | | | unevaluated expression context, such as sizeof(), or decltype(). Also adds a similar warning when the expression passed to typeid() *is* evaluated, since it is equally likely that the user would expect the expression operand to be unevaluated in that case. llvm-svn: 224465
* Sema: Warn on sizeof on binary ops on decayed arrays.Benjamin Kramer2013-03-291-1/+1
| | | | | | | | | | | | | The array will decay into a pointer, creating an unexpected result. sizeof(array + int) is an easy to make typo for sizeof(array) + int. This was motivated by a NetBSD security bug, used sizeof(key - r) instead of sizeof(key) - r, reducing entropy in a random number generator. http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_cprng.c.diff?r1=1.14&r2=1.15&only_with_tag=MAIN&f=h Differential Revision: http://llvm-reviews.chandlerc.com/D571 llvm-svn: 178371
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-191-0/+1
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* Make the "unused result" warning a warning about run-time behavior, soDouglas Gregor2010-07-151-4/+4
| | | | | | that we don't warn when there isn't going to be any computation anyway. llvm-svn: 108442
* Fix rdar://8139785 "implement warning on dead expression in comma operator"Argyrios Kyrtzidis2010-06-301-4/+4
| | | | | | | | | | As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g: x || test_logical_foo1(); emitted a bogus "expression result unused" for 'x'. llvm-svn: 107274
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - 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
* Use clang to run tests which include headers from the system.Daniel Dunbar2009-11-171-1/+0
| | | | llvm-svn: 89085
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* c89 does not perform array -> pointer promotion unless the array is an ↵Chris Lattner2008-07-251-6/+6
| | | | | | | | lvalue. This is different than C99. This fixes the rest of rdar://6095180. llvm-svn: 54064
* In c99 mode, comma does do function/array promotion even though Chris Lattner2008-07-251-4/+11
| | | | | | it does not do unary promotions (like short->int). llvm-svn: 54058
* Comma does not perform unary promotions, rdar://6095180Chris Lattner2008-07-251-0/+11
llvm-svn: 54045
OpenPOWER on IntegriCloud