summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/conversion.c
Commit message (Collapse)AuthorAgeFilesLines
* Only emit implicit constant conversion truncation warnings in reachable ↵Ted Kremenek2011-10-221-0/+72
| | | | | | code. Apparently this is what GCC does, and some code depends on this. Fixes <rdar://problem/10321089>. llvm-svn: 142716
* Frontend: Replace -nostdinc by -nostdsysteminc (which is just system includeDaniel Dunbar2011-10-111-1/+3
| | | | | | paths). The -nostdinc behavior is now -nostdsysteminc + -nobuiltininc. llvm-svn: 141691
* Teach -Wconversion, -Wsign-compare etc. about division and remainder.John McCall2011-07-141-0/+8
| | | | llvm-svn: 135208
* When we're determining whether to complain about a conversion from oneDouglas Gregor2011-03-121-0/+4
| | | | | | | | enumeration type to another in C, classify enumeration constants as if they had the type of their enclosing enumeration. Fixes <rdar://problem/9116337>. llvm-svn: 127514
* Warn about implicit conversions between values of different, namedDouglas Gregor2011-02-221-0/+21
| | | | | | enumeration types. Fixes <rdar://problem/8559831>. llvm-svn: 126183
* Split out -Wconversion warnings about constant precision into theirJohn McCall2010-11-091-16/+16
| | | | | | | | | | | own subcategory, -Wconstant-conversion, which is on by default. Tweak the constant folder to give better results in the invalid case of a negative shift amount. Implements rdar://problem/6792488 llvm-svn: 118636
* Track the location of the context requiring an implicit conversion and use itJohn McCall2010-10-081-0/+13
| | | | | | to white-list conversions required by system headers. rdar://problem/8232669 llvm-svn: 116029
* Refer to implicit "conversions" rather than implicit "casts", whichDouglas Gregor2010-07-091-65/+65
| | | | | | don't technically exist in the language. <rdar://problem/8085982> llvm-svn: 107995
* Rearchitect -Wconversion and -Wsign-compare. Instead of computing themJohn McCall2010-05-061-0/+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
* Don't assert on compound assignment operators that operate in FP types whenJohn McCall2010-02-231-0/+8
| | | | | | the result is integral. Fixes <rdar://problem/7676608>. llvm-svn: 96970
* Make this test not rely on the system <limits.h>. Hopefully fixes theJohn McCall2010-02-111-2/+2
| | | | | | MSVC build. llvm-svn: 95932
* Test case for warnings with carets inside macro instantiations.John McCall2010-02-111-0/+8
| | | | llvm-svn: 95893
* Insulate these from changes to the default for -Wunreachable-code.Mike Stump2010-01-231-1/+1
| | | | llvm-svn: 94326
* Derive tighter ranges for & and >> in the conversion-checking code.John McCall2010-01-061-0/+10
| | | | llvm-svn: 92862
* Significantly rework the calculation of effective integer-expression rangesJohn McCall2010-01-061-0/+26
| | | | | | | | | | | | for -Wsign-compare and -Wconversion, and use that coordinated logic to drive both diagnostics. The new logic works more transparently with implicit conversions, conditional operators, etc., as well as bringing -Wconversion's ability to deal with pseudo-closed operations (e.g. arithmetic on shorts) to -Wsign-compare. Fixes PRs 5887, 5937, 5938, and 5939. llvm-svn: 92823
* 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
* Fix PR 5422: handle lvalue results when evaluating 'based' ptrtoints as part ofJohn McCall2009-11-111-0/+6
| | | | | | the -Wconversion check. llvm-svn: 86891
* Improve -Wconversion by permitting binary operations on values of the targetJohn McCall2009-11-071-0/+5
| | | | | | type (or smaller) to stay "closed" within the type. llvm-svn: 86356
* Test case for -Wconversion.John McCall2009-11-071-0/+226
llvm-svn: 86327
OpenPOWER on IntegriCloud