summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Add support of -x objc-cpp-output, -x objc++-cpp-output to the Driver.Nico Weber2011-08-132-0/+15
| | | | | | Matches gcc, and is also required for using ccache with clang. llvm-svn: 137563
* MacOSKeychainAPIChecker: Test all APIs.Anna Zaks2011-08-131-9/+24
| | | | llvm-svn: 137549
* Update clang tests for r137527.Eli Friedman2011-08-127-284/+284
| | | | llvm-svn: 137535
* MacOSKeychainAPIChecker: If the allocated data address entered as an ↵Anna Zaks2011-08-121-0/+11
| | | | | | enclosing function parameter, skip it to avoid false positives. llvm-svn: 137526
* MacOSKeychainAPIChecker: Anna Zaks2011-08-121-13/+17
| | | | | | | | Report errors earlier: on checkDeadSymbols() and clear the state after the symbol we are tracking goes out of scope. Also, perform lazy error checking. Instead of forcing the paths to be split depending one the return value of the allocator, make the return symbol depend on the allocated data symbol, which prolongs its life span to the time when the allocated data symbol becomes dead. llvm-svn: 137523
* Conversions to bool count as integer conversions for the purposes ofJeffrey Yasskin2011-08-121-0/+6
| | | | | | the C++0x narrowing error. llvm-svn: 137512
* Place err_cfstring_literal_not_string_constant and warn_cfstring_truncated ↵Ted Kremenek2011-08-121-2/+1
| | | | | | under "-WCFString" flag. llvm-svn: 137508
* Place diagnostic warn_stringcompare under the "-Wstring-compare" flag.Ted Kremenek2011-08-121-2/+1
| | | | llvm-svn: 137507
* Place warnings related to incorrect "main()" declaration under "-Wmain".Ted Kremenek2011-08-121-3/+1
| | | | llvm-svn: 137506
* Add -Wtypename-missing flag for diagnostic warn_typename_missing.Ted Kremenek2011-08-121-2/+1
| | | | llvm-svn: 137505
* Revert "Fix crash in CFGBuilder involving implicit destructor calls and ↵Ted Kremenek2011-08-121-23/+0
| | | | | | gotos jumping after an object was declared. Fixes PR 10620." llvm-svn: 137459
* De-Unicode-ify.NAKAMURA Takumi2011-08-125-19/+19
| | | | llvm-svn: 137430
* Fix a raw string literal test case to actually use a raw string literal.Craig Topper2011-08-121-1/+1
| | | | llvm-svn: 137427
* Fix crash in CFGBuilder involving implicit destructor calls and gotos ↵Ted Kremenek2011-08-121-0/+23
| | | | | | jumping after an object was declared. Fixes PR 10620. llvm-svn: 137426
* Fix a couple raw string literal testsCraig Topper2011-08-122-7/+0
| | | | llvm-svn: 137422
* The current warning in -Wnull-arithmetic for comparisons between NULL and ↵Richard Trieu2011-08-111-7/+7
| | | | | | | | | | | | | | | | | non-pointers is not very helpful. This patch will update the wording to be more helpful to users. Old warning: warning: use of NULL in arithmetic operation [-Wnull-arithmetic] return 10 <= NULL; ^ ~~~~ New warning: warning: comparison between NULL and non-pointer ('int' and NULL) [-Wnull-arithmetic] return 10 <= NULL; ~~ ^ ~~~~ llvm-svn: 137377
* Add diagtool-based test where we enforce that no additional warnings can be ↵Ted Kremenek2011-08-112-1/+338
| | | | | | added to Clang without a -W flag. llvm-svn: 137369
* Add tests for string literal concatenation.Craig Topper2011-08-112-0/+48
| | | | llvm-svn: 137302
* Add support for C++0x raw string literals.Craig Topper2011-08-114-1/+49
| | | | llvm-svn: 137298
* Simplify EH control flow by observing that EH scopes form a simpleJohn McCall2011-08-115-22/+15
| | | | | | | | | | | | | | | hierarchy of delegation, and that EH selector values are meaningful function-wide (good thing, too, or inlining wouldn't work). 2,3d 1a hierarchy of delegation and that EH selector values have the same meaning everywhere in the function instead of being meaningful only in the context of a specific selector. This removes the need for routing edges through EH cleanups, since a cleanup simply always branches to its enclosing scope. llvm-svn: 137293
* When performing the lookup in the current scope for a member access toDouglas Gregor2011-08-101-0/+18
| | | | | | | | | | | | a member template, e.g., x.f<int> if we have found a template in the type of x, but the lookup in the current scope is ambiguous, just ignore the lookup in the current scope. Fixes <rdar://problem/9915664>. llvm-svn: 137255
* [arcmt] When checking whether properties needs to be strong or not, take ↵Argyrios Kyrtzidis2011-08-102-8/+8
| | | | | | | | into account that assigning result of -retain means it should be strong. rdar://9931757. llvm-svn: 137252
* [libclang] When pointing at an objc property don't return a cursor that ↵Argyrios Kyrtzidis2011-08-101-0/+11
| | | | | | | | points at the synthesized method for the property. rdar://9771715 llvm-svn: 137248
* Add the new unit test that I managed to leave out of r136997 :/Kaelyn Uhrain2011-08-101-0/+33
| | | | llvm-svn: 137242
* Add a test case for the divide-by-zero fix in r137234Kaelyn Uhrain2011-08-101-0/+14
| | | | llvm-svn: 137240
* objective-c: Using existing infrastructure for finding Fariborz Jahanian2011-08-103-49/+33
| | | | | | | | | overridden methods to diagnose their type mismatch. This is a general solution for previous fixes for // rdar://6191214 and // rdar://9352731 and removes lots of duplicate code. llvm-svn: 137222
* Expand test of C++0x [class.copymove]p15 to make sure we're actually calling ↵Douglas Gregor2011-08-101-0/+7
| | | | | | the copy constructor of a base/member from an explicitly-defaulted copy constructor, rather than the default constructor llvm-svn: 137220
* When adding the base and member initializers for an implicitly-definedDouglas Gregor2011-08-101-0/+11
| | | | | | | special member function, make sure to classify an explicitly-defaulted copy constructor as a "copy" operation. Fixes PR10622. llvm-svn: 137219
* For the availability attribute, allow a declaration to be deprecatedDouglas Gregor2011-08-101-1/+2
| | | | | | in the same version that it is introduced. Stuff happens. llvm-svn: 137214
* Rewrite default initialization of anonymous structs/unions within aDouglas Gregor2011-08-101-0/+49
| | | | | | | | | | | | | constructor. Previously, we did some bogus recursion into the fields of anonymous structs (recursively), which ended up building invalid ASTs that would cause CodeGen to crash due to invalid GEPs. Now, we instead build the default initializations based on the indirect field declarations at the top level, which properly generates the sequence of GEPs needed to initialize the proper member. Fixes PR10512 and <rdar://problem/9924046>. llvm-svn: 137212
* Change an assert into a check. I'm pretty sure there was a pointJohn McCall2011-08-101-0/+11
| | | | | | | | in time when this assert was valid, but it's not valid now. Also teach this code to correctly introduce function-to-pointer decay. llvm-svn: 137201
* Thread Safety: Added basic argument parsing for all new attributes.Caitlin Sadowski2011-08-091-78/+440
| | | | | | | | | | | | This patch special cases the parser for thread safety attributes so that all attribute arguments are put in the argument list (instead of a special parameter) since arguments may not otherwise resolve correctly without two-token lookahead. This patch also adds checks to make sure that attribute arguments are lockable objects. llvm-svn: 137130
* Make sure to canonicalize the argument type of a non-type templateDouglas Gregor2011-08-091-0/+57
| | | | | | argument of enumeration type when checking template arguments. Fixes PR10579. llvm-svn: 137101
* Hand materialization of temporary expressions when emitting a scalarDouglas Gregor2011-08-091-0/+13
| | | | | | expression. Fxies PR10592. llvm-svn: 137086
* Don't emit memcpy for copying fields of arrays of volatile elements.Fariborz Jahanian2011-08-091-0/+43
| | | | | | | Use the the path that generates a loop. This fixes bogus error that clang puts out. // rdar://9894548 llvm-svn: 137080
* Fix another -Wuninitialized assertion failure (this one involving bit casts) ↵Ted Kremenek2011-08-081-0/+11
| | | | | | resulting from the recent -Wuninitialized changes. llvm-svn: 137068
* objective-c: diagnose protocol inconsistencies in following Fariborz Jahanian2011-08-082-3/+42
| | | | | | | | | situation. When a class explicitly or implicitly (through inheritance) "conformsTo" two protocols which conflict (have methods which conflict). This patch fixes the previous patch where warnings were coming out in non-deterministic order. This is 2nd part of // rdar://6191214. llvm-svn: 137055
* Do l-value conversion, etc., on a switch condition expression inJohn McCall2011-08-061-0/+13
| | | | | | | | | | ActOnStartOfSwitchStmt (i.e. before binding up a full-expression) instead of ActOnFinishSwitchStmt. Among other things, this means that property l-values are properly converted inside the full-expression. llvm-svn: 137014
* Be sure to destroy the normal entry block of a cleanup that weJohn McCall2011-08-062-4/+26
| | | | | | | | | | | | | | | aren't actually going to make a normal cleanup for. Sometimes we optimistically create branches to such blocks for fixups, and then we resolve the fixup to somewhere within the cleanup's scope, and then the cleanup is actually not reachable for some reason. The process of resolving the fixup leaves us with switches whose default edge leads to the cleanup; we can replace that with unreachable, then (in many cases) turn the switch into an unconditional branch. Fixes PR10467. llvm-svn: 137011
* [analyzer] add more buffer overflow tests to show we handle sizeof(VLA) in ↵Ted Kremenek2011-08-061-0/+18
| | | | | | obstruse ways... llvm-svn: 137007
* Revert 136984 and 136927.Ted Kremenek2011-08-052-51/+3
| | | | llvm-svn: 136998
* Perform array bounds checking in more situations and properly handle specialKaelyn Uhrain2011-08-051-3/+18
| | | | | | | | | | | | | | | | case situations with the unary operators & and *. Also extend the array bounds checking to work with pointer arithmetic; the pointer arithemtic checking can be turned on using -Warray-bounds-pointer-arithmetic. The changes to where CheckArrayAccess gets called is based on some trial & error and a bunch of digging through source code and gdb backtraces in order to have the check performed under as many situations as possible (such as for variable initializers, arguments to function calls, and within conditional in addition to the simpler cases of the operands to binary and unary operator) while not being called--and triggering warnings--more than once for a given ArraySubscriptExpr. llvm-svn: 136997
* Add support for using anonymous bitfields (e.g., int : 0) to enforce alignment.Chad Rosier2011-08-051-13/+123
| | | | | | | | | | | | | | | This fixes cases where the anonymous bitfield is followed by a bitfield member. E.g., struct t4 { char foo; long : 0; char bar : 1; }; rdar://9859156 llvm-svn: 136991
* Make test/SemaObjC/qualified-protocol-method-conflicts.m always fail and ↵Ted Kremenek2011-08-051-0/+5
| | | | | | mark it XFAIL. This is a stop gap until the output of the test is deterministic. llvm-svn: 136984
* Flesh out the -Warray-bounds detection of C89 tail-padded one-elementChandler Carruth2011-08-051-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | arrays. This now suppresses the warning only in the case of a one-element array as the last field in a struct where the array size is a literal '1' rather than any macro expansion or template parameter. This doesn't distinguish between the language standard in use to allow code which dates from C89 era to compile without the warning even in C99 and C++ builds. We could add a separate warning (under a different flag) with fixit hints to switch to a flexible array, but its not clear that this would be desirable. Much of the code using this idiom is striving for maximum portability. Tests were also fleshed out a bit, and the diagnostic itself tweaked to be more pretty w.r.t. single elment arrays. This is more ugly than I would like due to APInt's not being supported by the diagnostic rendering engine. A pseudo-patch for this was proposed by Nicola Gigante, but I reworked it both for several correctness issues and for code style. Sorry this was so long in coming. llvm-svn: 136965
* Fixed FieldDecl source range.Abramo Bagnara2011-08-051-0/+6
| | | | llvm-svn: 136963
* Output to /dev/null, not "0"Matt Beaumont-Gay2011-08-051-1/+1
| | | | llvm-svn: 136955
* KeychainAPI checker: Generate an error on double allocation. Pull out ↵Anna Zaks2011-08-051-5/+7
| | | | | | getAsPointeeMemoryRegion so that it could be reused. llvm-svn: 136952
* Extend memset/memcpy/memmove checking to include memcmpMatt Beaumont-Gay2011-08-051-0/+13
| | | | llvm-svn: 136950
* The continue label in an ARC for-in loop should not involveJohn McCall2011-08-051-0/+21
| | | | | | releasing the collection. llvm-svn: 136949
OpenPOWER on IntegriCloud