summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/self-comparison.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* Fix a couple of wrong self-comparison diagnostics.Richard Smith2018-01-071-0/+5
| | | | | | | | Check whether we are comparing the same entity, not merely the same declaration, and don't assume that weak declarations resolve to distinct entities. llvm-svn: 321976
* For self-comparison warning, check the source location of both the LHS and ↵Ted Kremenek2010-09-161-0/+11
| | | | | | | | | | | RHS to see if they are expanded from macros (and if so, omit the warning). Previously we were just looking at the location of the binary expression. Fixes <rdar://problem/8435950>. llvm-svn: 114044
* Fix another aspect of PR7047, macro expansions. Previously, this was hackedChandler Carruth2010-07-121-6/+4
| | | | | | | | | | | | around by exempting enums from the check, but this doesn't handle a lot of cases. A better approach is to directly check if the operator comes from a macro expansion. I've removed a reference to the rdar that originally led to the enum suppression when removing it's overly contrived test case. Let me know if that number or a more reasilistic test case involving enums is still needed. llvm-svn: 108128
* Warn about comparisons between arrays and improve self-comparisonDouglas Gregor2010-06-081-2/+43
| | | | | | warnings, from Troy Straszheim! Fixes PR6163. llvm-svn: 105631
* Don't emit string-comparison or self-comparison warnings inDouglas Gregor2010-01-121-0/+5
| | | | | | | | | | unevaluated contexts, because they only matter for code that will actually be evaluated at runtime. As part of this, I had to extend PartialDiagnostic to support fix-it hints. llvm-svn: 93266
* 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
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Fix <rdar://problem/6703892> by not warning about self-comparisons of enumTed Kremenek2009-03-201-0/+8
| | | | | | constants. llvm-svn: 67390
* Added to test case for "self-comparison check" uses of relation operators: x ↵Ted Kremenek2007-10-291-1/+9
| | | | | | | | < x and x > x should emit warnings. llvm-svn: 43451
* For non-floating point types, added check for expressions of the formTed Kremenek2007-10-291-0/+17
"x == x" and "x != x". We emit a warning for these since they always evaluate to a constant value and often indicate a logical error. Added test case for this check. llvm-svn: 43450
OpenPOWER on IntegriCloud