summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/compare.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-051-1/+1
| | | | llvm-svn: 196510
* Change the other -Wtautological-compare warnings to not trigger in templateRichard Trieu2013-11-021-0/+16
| | | | | | | specializations. Also switch to -Wuninitialized for a test case that depended on a warning firing in template specializations. llvm-svn: 193906
* Add non-type template parameter test for disabled -Wtautological-compareRichard Trieu2013-11-011-0/+6
| | | | | | warning in template specializations. llvm-svn: 193890
* Disable -Wtautological-compare in template instantiations.Richard Trieu2013-11-011-0/+19
| | | | llvm-svn: 193888
* Disable -Wtautological-constant-out-of-range-compare in template instantiations.Richard Trieu2013-11-011-0/+26
| | | | llvm-svn: 193887
* Enhance -Wtautological-constant-out-of-range-compare to include the name of ↵Ted Kremenek2013-03-151-8/+8
| | | | | | | | the enum constant. This is QoI. Fixes <rdar://problem/13076064>. llvm-svn: 177190
* Make -Wtautological-constant-out-of-range-compare behave sanely for enums ↵Eli Friedman2012-11-301-1/+8
| | | | | | | | with a signed fixed type. <rdar://problem/12780159>. llvm-svn: 169051
* Take into account the zero sign bit for positive numbers when computing the bitRichard Trieu2012-11-161-0/+10
| | | | | | | width of an enum with negative values in IntRange. Include a test for -Wtautological-constant-out-of-range-compare where this had manifested. llvm-svn: 168126
* Fix an off-by-one error by switching < to <= in ↵Richard Trieu2012-11-151-0/+1
| | | | | | -Wtautological-constant-out-of-range-compare and added test case. llvm-svn: 168023
* Improve -Wtautological-constant-out-of-range-compare by taking into accountRichard Trieu2012-11-141-0/+114
| | | | | | | | | type conversion between integers. This allows the warning to be more accurate. Also, turned the warning off in an analyzer test. The relavent test cases are covered by the tests in Sema. llvm-svn: 167992
* Improvements to my patch in r164143 perFariborz Jahanian2012-09-201-16/+16
| | | | | | Richard's comments. // rdar://12202422 llvm-svn: 164316
* c: warn when an integer value comparison with anFariborz Jahanian2012-09-181-16/+16
| | | | | | | | integral expression have the obvious result. Patch reviewed by John McCall off line. // rdar://12202422 llvm-svn: 164143
* Remove warning for conditional operands of differend signedness from ↵Richard Trieu2011-07-211-0/+11
| | | | | | -Wsign-compare. Cases that previously warn on this will have a different warning emitted from -Wsign-conversion. llvm-svn: 135664
* Don't produce "comparison is always (true|false)" warnings when theDouglas Gregor2011-02-191-0/+6
| | | | | | comparison itself is a constant expression. Fixes PR7536. llvm-svn: 126057
* Update equality and relationship comparisons of pointers to reflectDouglas Gregor2010-06-151-0/+8
| | | | | | | | | C++ semantics, eliminating an extension diagnostic that doesn't match C++ semantics (ordered comparison with NULL) and tightening some extwarns to errors in C++ to match GCC and maintain conformance in SFINAE contexts. Fixes <rdar://problem/7941392>. llvm-svn: 106050
* Rearchitect -Wconversion and -Wsign-compare. Instead of computing themJohn McCall2010-05-061-10/+10
| | | | | | | | | | | | | | "bottom-up" when implicit casts and comparisons are inserted, compute them "top-down" when the full expression is finished. Makes it easier to coordinate warnings and thus implement -Wconversion for signedness conversions without double-warning with -Wsign-compare. Also makes it possible to realize that a signedness conversion is okay because the context is performing the inverse conversion. Also simplifies some logic that was trying to calculate the ultimate comparison/result type and getting it wrong. Also fixes a problem with the C++ explicit casts which are often "implemented" in the AST with a series of implicit cast expressions. llvm-svn: 103174
* 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
* First pass at implementing C++ enum semantics: calculate (and store) anJohn McCall2009-12-091-10/+15
| | | | | | | | | | | | "integer promotion" type associated with an enum decl, and use this type to determine which type to promote to. This type obeys C++ [conv.prom]p2 and is therefore generally signed unless the range of the enumerators forces it to be unsigned. Kills off a lot of false positives from -Wsign-compare in C++, addressing rdar://7455616 llvm-svn: 90965
* Improve the -Wsign-compare heuristics:John McCall2009-11-061-12/+192
| | | | | | | | | | | | | * If the unsigned type is smaller than the signed type, never warn, because its value will not change when zero-extended to the larger type. * If we're testing for (in)equality, and the unsigned value is an integer constant whose sign bit is not set, never warn, because even though the signed value might change, it can't affect the result of the equality. Also make the comparison test cases much more rigorous, and have them expose the subtle differences between C and C++ here. llvm-svn: 86242
* Turn off -Wsign-compare warnings by defaultDouglas Gregor2009-11-061-1/+1
| | | | llvm-svn: 86233
* Implement the conditional-operator part of -Wsign-compare. TurnJohn McCall2009-11-051-0/+15
DiagnoseSignCompare into Sema::CheckSignCompare and call it from more places. Add some enumerator tests. These seem to expose some oddities in the types we're converting C++ enumerators to; in particular, they're converting to unsigned before int, which seems to contradict 4.5 [conv.prom] p2. Note to self: stop baiting Doug in my commit messages. llvm-svn: 86128
OpenPOWER on IntegriCloud