summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Support strlen() and __builtin_strlen() as constant expressions withDouglas Gregor2010-09-101-0/+4
| | | | | | | the call argument is a string literal. Fixes <rdar://problem/8413477>. llvm-svn: 113580
* Check format strings when a called function has more than one FormatAttr ↵Ted Kremenek2010-09-091-1/+10
| | | | | | (one for 'scanf' and one for 'printf'). Fixes <rdar://problem/8409437>. llvm-svn: 113472
* It appears that technically a null format string is not warned under ↵Ted Kremenek2010-09-091-0/+7
| | | | | | | | -Wformat-nonliteral, as the function processing the format string can decided whether or not to accept a null format string (e.g., asl_log). Fixes <rdar://problem/8269537>. llvm-svn: 113469
* Enhance -Wunreachable-code to not consider the 'default:' branch of a switch ↵Ted Kremenek2010-09-091-0/+16
| | | | | | | | statement live if a switch on an enum value has explicit 'case:' statements for each enum value. llvm-svn: 113451
* Enhance -Wreturn-type to not warn when control-flow is most likely limited ↵Ted Kremenek2010-09-091-0/+13
| | | | | | | | by a switch statement explicitly covering all the cases for an enum value. llvm-svn: 113450
* tests: Use -ffreestanding when including stdint.h, to avoid platform ↵Daniel Dunbar2010-09-072-2/+2
| | | | | | dependencies. llvm-svn: 113301
* Have Sema check for validity of CGString literalFariborz Jahanian2010-09-071-1/+1
| | | | | | instead of asserting in IRGen. Fixes radar 8390459. llvm-svn: 113253
* Provide a specific diagnostic when trying to redefine an "externDouglas Gregor2010-09-071-0/+4
| | | | | | | inline" function outside of GNU89 mode. Fixes <rdar://problem/6880464>. llvm-svn: 113204
* fix PR7192 by defining wchar_t in a more conventional way. TheChris Lattner2010-09-051-0/+6
| | | | | | type of L"x" can change based on command line arguments. llvm-svn: 113127
* print "const intptr_t" instead of "intptr_t const"Chris Lattner2010-09-051-1/+1
| | | | llvm-svn: 113091
* make clang print types as "const int *" instead of "int const*",Chris Lattner2010-09-0510-13/+13
| | | | | | | which is should have done from the beginning. As usual, the most fun with this sort of change is updating all the testcases. llvm-svn: 113090
* Get rid of the "functions declared 'noreturn' should have a 'void' result ↵Anders Carlsson2010-09-035-7/+7
| | | | | | | | | type" warning. The rationale behind this is that it is normal for callback functions to have a non-void return type and it should still be possible to mark them noreturn. (JavaScriptCore is a good example of this). llvm-svn: 112918
* when emitting an error about a missing } in a compound statement, emitChris Lattner2010-09-011-1/+2
| | | | | | a "to match this {" note, pointing out the opener. llvm-svn: 112709
* With lax vector conversions (the default) make sure we convert between twoEric Christopher2010-08-261-1/+1
| | | | | | | | | vectors that are the same size. Fix up testcases accordingly and add a new one to make sure we still error if lax vector conversions are disabled. Fixes rdar://8328190 llvm-svn: 112122
* Implement __builtin_printf, __builtin_fprintf. Fixes <rdar://problem/8336581>.Douglas Gregor2010-08-251-0/+5
| | | | llvm-svn: 112049
* Recursive functions should be marked when used from another function. Fixes ↵Argyrios Kyrtzidis2010-08-251-0/+3
| | | | | | http://llvm.org/PR7923. llvm-svn: 112045
* Fix printf format string checking for '%lc' (which expects a wint_t or ↵Ted Kremenek2010-08-241-0/+15
| | | | | | compatible argument). Fixes PR 7981. llvm-svn: 111978
* Fix for PR7911 and PR7921: make isIntegralOrEnumerationType return falseEli Friedman2010-08-191-0/+6
| | | | | | | | | | | for incomplete enum types. An incomplete enum can't really be treated as an "integral or enumeration" type, and the incorrect treatment leads to bad behavior for many callers. This makes isIntegralOrEnumerationType equivalent to isIntegerType; I think we should globally replace the latter with the former; thoughts? llvm-svn: 111512
* Add warning for functions/blocks that have attribute 'noreturn' but return a ↵Ted Kremenek2010-08-195-7/+7
| | | | | | non-void result. (<rdar://problem/7562925>) llvm-svn: 111492
* Emit an error if an array is too large. We're slightly more strictDouglas Gregor2010-08-182-0/+17
| | | | | | | | | | | | | than GCC 4.2 here when building 32-bit (where GCC will allow allocation of an array for which we can't get a valid past-the-end pointer), and emulate its odd behavior in 64-bit where it only allows 63 bits worth of storage in the array. The former is a correctness issue; the latter is harmless in practice (you wouldn't be able to use such an array anyway) and helps us pass a GCC DejaGNU test. Fixes <rdar://problem/8212293>. llvm-svn: 111338
* Commit improved version of 111026 & 111027.Argyrios Kyrtzidis2010-08-151-0/+9
| | | | | | | | | | | | | | | | | | | | Unused warnings for functions: -static functions -functions in anonymous namespace -class methods in anonymous namespace -class method specializations in anonymous namespace -function specializations in anonymous namespace Unused warnings for variables: -static variables -variables in anonymous namespace -static data members in anonymous namespace -static data members specializations in anonymous namespace Reveals lots of opportunities for dead code removal in llvm codebase that will interest my esteemed colleagues. llvm-svn: 111086
* PR7884: Fix the implementations of __real__ and __imag__ on real floats.Eli Friedman2010-08-141-2/+6
| | | | llvm-svn: 111080
* PR3344: Downgrade "too many braces around scalar initializer" to a warning.Eli Friedman2010-08-141-1/+1
| | | | llvm-svn: 111067
* Revert 111026 & 111027, build breakage.Argyrios Kyrtzidis2010-08-131-9/+0
| | | | llvm-svn: 111036
* Expand the unused warnings for functions. Warn for:Argyrios Kyrtzidis2010-08-131-0/+9
| | | | | | | | | | -static function declarations -functions in anonymous namespace -class methods in anonymous namespace -class method specializations in anonymous namespace -function specializations in anonymous namespace llvm-svn: 111026
* Implement -Wcast-align. The initial design of this diagnostic diverges John McCall2010-08-121-0/+41
| | | | | | | | from GCC's in that we warn on *any* increase in alignment requirements, not just those that are enforced by hardware. Please let us know if this causes major problems for you (which it shouldn't, since it's an optional warning). llvm-svn: 110959
* Fix redefinition of typedefs of fixable variably-modified array types; shouldEli Friedman2010-08-101-1/+6
| | | | | | fix an issue compiling <windows.h>. llvm-svn: 110651
* Make sure that we diagnose attribute((overloadable)) functions withoutDouglas Gregor2010-08-061-1/+10
| | | | | | prototypes. Fixes PR7738. llvm-svn: 110443
* Introduce implicit conversions between AltiVec vectors and GCCDouglas Gregor2010-08-061-0/+19
| | | | | | vectors, from Anton Yartsev! llvm-svn: 110437
* Labels (and case statement) don't create independent scope parents for theJohn McCall2010-08-021-16/+16
| | | | | | | | purposes of the jump checker. Also extend Ted's iteration fix to labels. Fixes PR7789. llvm-svn: 110082
* Allow a looser form of compatibility checking (which ignoresDouglas Gregor2010-07-291-0/+11
| | | | | | | qualifiers) when checking a K&R function definition against a previous prototype. Fixes <rdar://problem/8193107>. llvm-svn: 109751
* Reword the empty struct/union warning in C to note that such structs and ↵Douglas Gregor2010-07-292-3/+5
| | | | | | unions have size 0 in C, size 1 in C++. Put this warning under -Wc++-compat. llvm-svn: 109748
* Make the pointer arguments to the __sync_* builtins pointers toDouglas Gregor2010-07-281-0/+6
| | | | | | volatile-qualified types. Fixes <rdar://problem/8228293>. llvm-svn: 109618
* Mark __builtin_eh_return as noreturn. Patch by Dimitry Andric.Benjamin Kramer2010-07-261-0/+4
| | | | llvm-svn: 109452
* turn down the logical bitwise confusion warning to not warn Chris Lattner2010-07-242-5/+6
| | | | | | | | | when the RHS of the ||/&& is ever 0 or 1. This handles a variety of creative idioms for "true" used in C programs and fixes many false positives at the expense of a few false negatives. This fixes rdar://8230351. llvm-svn: 109314
* Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.Fariborz Jahanian2010-07-231-0/+5
| | | | | | Radar 8218839. llvm-svn: 109272
* Vectors are not integer types, so the type system should not classifyDouglas Gregor2010-07-231-0/+25
| | | | | | | | | | | them as such. Type::is(Signed|Unsigned|)IntegerType() now return false for vector types, and new functions has(Signed|Unsigned|)IntegerRepresentation() cover integer types and vector-of-integer types. This fixes a bunch of latent bugs. Patch from Anton Yartsev! llvm-svn: 109229
* Hookup checking for invalid length modifiers in scanf format strings.Ted Kremenek2010-07-201-0/+8
| | | | llvm-svn: 108907
* Don't warn when a '%%' or '%*d' (scanf) is used in a format string with ↵Ted Kremenek2010-07-192-0/+9
| | | | | | | | positional arguments, since these don't actually consume an argument. llvm-svn: 108757
* Hook up 'invalid conversion' warning for scanf format strings.Ted Kremenek2010-07-191-0/+1
| | | | llvm-svn: 108750
* Add missing conversion specifier parsing for 'u', 'x', 'o', and 's'. Fixes ↵Ted Kremenek2010-07-191-0/+3
| | | | | | <rdar://problem/8204052>. llvm-svn: 108742
* Improve the representation of the atomic builtins in a few ways. First, we makeChandler Carruth2010-07-181-0/+5
| | | | | | | | | | | | | | | their call expressions synthetically have the "deduced" types based on their first argument. We only insert conversions in the AST for arguments whose values require conversion to match the value type expected. This keeps PR7600 closed by maintaining the return type, but avoids assertions due to unexpected implicit casts making the type unsigned (test case added from Daniel). The magic is moved into the codegen for the atomic builtin which inserts the casts as needed at the IR level to raise the type to an integer suitable for the LLVM intrinsic. This shouldn't cause any real change in functionality, but now we can make the builtin be more truly polymorphic. llvm-svn: 108638
* Check for casts to an incomplete type in C. Improves diagnostics for cast toEli Friedman2010-07-171-0/+14
| | | | | | | incomplete union (PR5692) and incomplete enum, and fixes obscure accepts-invalid on cast to incomplete struct. llvm-svn: 108630
* Remove unicode quotes characters that somehow made it into a recent commit ↵Ted Kremenek2010-07-161-1/+1
| | | | | | of mine. llvm-svn: 108552
* Hook up warning for an incomplete scanlist in scanf format strings.Ted Kremenek2010-07-161-0/+1
| | | | llvm-svn: 108542
* Tweak zero-field width in scanf format string diagnostic.Ted Kremenek2010-07-161-2/+2
| | | | llvm-svn: 108541
* Sema: Fix a bug with #pragma options align=reset, reset against an empty stackDaniel Dunbar2010-07-161-0/+7
| | | | | | is well defined, it resets to the default alignment. llvm-svn: 108508
* Add initial test cases for scanf format string checking.Ted Kremenek2010-07-161-0/+14
| | | | llvm-svn: 108503
* Builtins/ARM: __clear_cache doesn't seem to have a consistent prototype, declareDaniel Dunbar2010-07-161-0/+11
| | | | | | | the builtin as void __clear_cache(...) to workaround this, which appears to match what GCC does. llvm-svn: 108487
* Make the "unused result" warning a warning about run-time behavior, soDouglas Gregor2010-07-153-8/+8
| | | | | | that we don't warn when there isn't going to be any computation anyway. llvm-svn: 108442
OpenPOWER on IntegriCloud