summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
Commit message (Collapse)AuthorAgeFilesLines
* When we attempt to create a built-in that involves a library type weDouglas Gregor2011-01-031-1/+4
| | | | | | | | | don't have access to (e.g., fprintf, which needs the library type FILE), fail with a warning and forget about the builtin entirely. Previously, we would actually provide an error, which breaks autoconf's super-lame checks for fprintf, longjmp, etc. Fixes PR8316. llvm-svn: 122744
* Produce a better error message for invalid register names.Rafael Espindola2011-01-011-0/+4
| | | | llvm-svn: 122670
* Added scalar casts test.Abramo Bagnara2010-12-281-0/+141
| | | | llvm-svn: 122599
* Improved complex constants evaluation.Abramo Bagnara2010-12-111-0/+12
| | | | llvm-svn: 121616
* Fix PR8720 by printing an error message with a substring that the gcc ↵Rafael Espindola2010-12-071-0/+8
| | | | | | testsuite searches for. llvm-svn: 121137
* When deciding whether to complain about the type of a boolean condition, useJohn McCall2010-12-041-0/+9
| | | | | | the type of the expression *after* array/function decay. llvm-svn: 120895
* Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall2010-12-041-1/+1
| | | | | | | | | | | | | | | | | | | not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. llvm-svn: 120890
* Mark functions referenced by 'cleanup' attribute as used. Fixes rdar://8728293Argyrios Kyrtzidis2010-12-041-0/+7
| | | | llvm-svn: 120872
* Merge transparent union types using member's unqualified typePeter Collingbourne2010-12-021-0/+4
| | | | llvm-svn: 120736
* Fix range in printf warnings for invalid conversion specifiers.Ted Kremenek2010-12-021-0/+1
| | | | llvm-svn: 120735
* Merge transparent union types using member's canonical param typePeter Collingbourne2010-12-021-0/+4
| | | | llvm-svn: 120729
* Attempt to fix linux buildbots by adding -ffreestanding for arm_neon tests.Bob Wilson2010-12-021-1/+1
| | | | | | | The arm_neon.h header includes stdint.h and it picks up the system header without -ffreestanding. llvm-svn: 120716
* Add a test for calling a Neon intrinsic macro with the wrong vector type.Bob Wilson2010-12-021-0/+13
| | | | | | | | This does not work so well with the -fno-lax-vector-conversions option for testing the arm_neon.h header but that is a really useful test, so I split this out to a separate Sema test to check for the warning. llvm-svn: 120694
* Incomplete enum types not to be treated as integer typeFariborz Jahanian2010-11-291-0/+13
| | | | | | | when checking for integer signed/unsigned-ness. PR8694, // rdar://8707031 llvm-svn: 120345
* Microsoft C anonymous struct implementation.Francois Pichet2010-11-231-4/+40
| | | | | | Documentation: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx llvm-svn: 120000
* test/Sema/x86-builtin-palignr.c: Now we can remove XFAIL:win32, according to ↵NAKAMURA Takumi2010-11-221-2/+0
| | | | | | r119958. llvm-svn: 119961
* The 'X' printf type has a valid alternative form. Fixes PR8641.Anders Carlsson2010-11-211-0/+5
| | | | llvm-svn: 119946
* Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:Argyrios Kyrtzidis2010-11-191-24/+0
| | | | | | | | | if (condition) CALL(0); // empty macro but don't warn for empty body. Fixes rdar://8436021. llvm-svn: 119838
* comparison of AltiVec vectors now gives bool result (fix for 7533)Anton Yartsev2010-11-181-1/+1
| | | | llvm-svn: 119678
* Don't emit warn_logical_and_in_logical_or for cases like "a && b || 0".Argyrios Kyrtzidis2010-11-171-0/+2
| | | | llvm-svn: 119540
* Don't warn for parentheses for the '&&' inside '||' for cases like:Argyrios Kyrtzidis2010-11-171-0/+6
| | | | | | | | | | | | assert(a || b && "bad"); since this is safe. This way we avoid a big source of such warnings which in this case are practically useless. Note that we don't handle *all* cases where precedence wouldn't matter because of constants since this is a bit costly to check, and IMO clarifying precedence with parentheses is good for readability in general. llvm-svn: 119533
* Warn about arg1 && arg2 || arg3, as GCC 4.3+ does. Fixes rdar://8659922Argyrios Kyrtzidis2010-11-161-0/+3
| | | | llvm-svn: 119381
* This really seems like a boring set of fixes to our tests to make them moreChandler Carruth2010-11-164-4/+7
| | | | | | | independent of the underlying system. Let me know if any of these are too aggressive. llvm-svn: 119345
* Add tests for new Neon vector type attributes.Bob Wilson2010-11-161-0/+33
| | | | llvm-svn: 119303
* Undo a refactor-o and base the bitfield-truncation warning on theJohn McCall2010-11-111-0/+18
| | | | | | | uncoerced value. Also, whitelist bool bitfields, which aren't really a truncation. llvm-svn: 118778
* Extend the bitfield-truncation warning to initializations.John McCall2010-11-111-0/+13
| | | | | | rdar://problem/8652606 llvm-svn: 118773
* When -Wconversion computes the range of a type, it uses the (bit-)range John McCall2010-11-101-0/+6
| | | | | | | | | | | of the enumerators rather than the actual expressible range. This is great when dealing with opaque *values* of that type, but when computing the range of the type for purposes of converting *into* it, it produces warnings in cases we don't care about (e.g. enum_t x = 500;). Divide the logic into these two cases and use the more conservative range for targets. llvm-svn: 118735
* Tweak to bitfield-overflow warning: don't warn about storingJohn McCall2010-11-101-0/+5
| | | | | | | a positive value into a signed bitfield of the exact width of the value. llvm-svn: 118657
* Typo.John McCall2010-11-091-1/+1
| | | | llvm-svn: 118649
* Add a warning for implicit truncation of constant values due toJohn McCall2010-11-091-0/+6
| | | | | | | | bitfield assignment. Implements rdar://problem/7809123 llvm-svn: 118647
* Split out -Wconversion warnings about constant precision into theirJohn McCall2010-11-092-16/+25
| | | | | | | | | | | 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
* Test moved to its correct place.Fariborz Jahanian2010-11-091-0/+12
| | | | llvm-svn: 118635
* Fix source locations in unnamed bitfield diagnostic, from JakubDouglas Gregor2010-11-091-0/+4
| | | | | | Wieczorek! Fixes PR8025. llvm-svn: 118481
* Document Clang's support for attributes on individual enumerators andJohn McCall2010-11-083-0/+6
| | | | | | | tweak the documentation for deprecation-with-message. Provide __has_feature tests for both. rdar://problem/8605692 llvm-svn: 118435
* When setting a tied check if it's already tied. If it's tied to another ↵Anders Carlsson2010-11-031-2/+8
| | | | | | constraint it's invalid. Fixes PR3905. llvm-svn: 118146
* A number in an input constraint can't point to a read-write ('+') ↵Anders Carlsson2010-11-031-0/+6
| | | | | | constraint. Fixes PR3904. llvm-svn: 118145
* When list-initializing a vector, try to copy-initialize from vectors insteadJohn McCall2010-10-301-0/+9
| | | | | | | | of descending into the subelements. rdar://problem/8345836 llvm-svn: 117749
* Implement an indirect-goto optimization for goto *&&lbl and respect thisJohn McCall2010-10-281-1/+31
| | | | | | | | | | | | | | in the scope checker. With that done, turn an indirect goto into a protected scope into a hard error; otherwise IR generation has to start worrying about declarations not dominating their scopes, as exemplified in PR8473. If this really affects anyone, I can probably adjust this to only hard-error on possible indirect gotos into VLA scopes rather than arbitrary scopes. But we'll see how people cope with the aggressive change on the marginal feature. llvm-svn: 117539
* Look through the address-of operator to find the function beingDouglas Gregor2010-10-251-0/+1
| | | | | | called. Fixes another aspect of PR8314. llvm-svn: 117308
* When we're calling a function that we know based on its K&R-styleDouglas Gregor2010-10-251-1/+12
| | | | | | | | function definition, we should still use a prototype to type-check and convert the function arguments, if such a prototype exists. Fixes PR8314. llvm-svn: 117305
* Implement GNU C extension: two types are compatible if they appearPeter Collingbourne2010-10-241-0/+18
| | | | | | | as a function argument, one of the types is a transparent union type and the other type is compatible with a union member llvm-svn: 117243
* - Fixed subexpressions evaluation order for binary operators to match order ↵Marcin Swiderski2010-10-241-4/+4
| | | | | | | | in code generated with the compiler, - Fixed test cases for unreachable code warnings produced by Sema. llvm-svn: 117220
* Move the "used but marked unused" warning behind a special warning flag for now.Anders Carlsson2010-10-242-2/+2
| | | | llvm-svn: 117219
* Warn if a variable marked with the "unused" attribute is used. Patch by ↵Anders Carlsson2010-10-222-4/+43
| | | | | | Darin Adler! llvm-svn: 117184
* Parse attributes on enumerators and instantiate attributes on enum decls.John McCall2010-10-221-0/+11
| | | | llvm-svn: 117182
* Previously, the printf warnings would say your arguments type was 'int' when ↵Ted Kremenek2010-10-211-1/+9
| | | | | | | | | | it was really a 'char' or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints. Patch by Justin Bogner! llvm-svn: 116996
* test/Sema/return.c: Cygwin does not have _longjmp().NAKAMURA Takumi2010-10-191-1/+1
| | | | | | | Although Cygwin-1.7 has _longjmp(), it would not be essential for this to distinguish Cygwin's version with <cygwin/version.h>. llvm-svn: 116783
* Microsoft enum extensions. 2 things will change on -fms-extensions:Francois Pichet2010-10-181-0/+12
| | | | | | | 1. enum underlying type is int by default. 2. Error "enumerator value is not representable in the underlying type"is a ExtWarning llvm-svn: 116704
* Allow list-initialization of a local variable of class type with aDouglas Gregor2010-10-151-2/+7
| | | | | | | | flexible array member, so long as the flexibility array member is either not initialized or is initialized with an empty initializer list. Fixes <rdar://problem/8540437>. llvm-svn: 116647
* zap trailing whitespaceGabor Greif2010-10-151-5/+5
| | | | llvm-svn: 116572
OpenPOWER on IntegriCloud