summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Use std::map instead of llvm::DenseMap because we rely on the stability of ↵Eli Friedman2012-06-251-0/+42
| | | | | | references to values in these maps. PR13197. llvm-svn: 159161
* [analyzer] Be careful about implicitly-declared operator new/delete. (PR13090)Jordan Rose2012-06-251-0/+15
| | | | | | | | The implicit global allocation functions do not have valid source locations, but we still want to treat them as being "system header" functions for the purposes of how they affect program state. llvm-svn: 159160
* Unrevert r158887, reverted in r158949, along with a fix for the bug whichRichard Smith2012-06-252-0/+71
| | | | | | | | | | | | | | | | | | | | resulted in it being reverted. A test for that bug was added in r158950. Original comment: If an object (such as a std::string) with an appropriate c_str() member function is passed to a variadic function in a position where a format string indicates that c_str()'s return type is desired, provide a note suggesting that the user may have intended to call the c_str() member. Factor the non-POD-vararg checking out of DefaultVariadicArgumentPromotion and move it to SemaChecking in order to facilitate this. Factor the call checking out of function call checking and block call checking, and extend it to cover constructor calls too. Patch by Sam Panzer! llvm-svn: 159159
* Thread safety analysis: implement lock_returned attribute.DeLesley Hutchins2012-06-251-0/+103
| | | | llvm-svn: 159152
* Make explicit specializations at class scope workNico Weber2012-06-251-0/+21
| | | | | | | for non-type template parameters in microsoft mode. PR12709. llvm-svn: 159147
* Add test for -Wused-but-marked-unused on private fields.Daniel Jasper2012-06-251-2/+4
| | | | llvm-svn: 159130
* [diagtool] Add a new "tree" command to shows warnings activated by a flag.Jordan Rose2012-06-241-0/+56
| | | | | | | | | | | | | | | | % diagtool tree -Wunused-value -Wunused-value -Wunused-comparison warn_unused_comparison -Wunused-result warn_unused_result warn_unused_call warn_unused_container_subscript_expr warn_unused_expr warn_unused_property_expr warn_unused_voidptr llvm-svn: 159093
* Recognize GNU attributes after 'enum class'. Fixes the libc++ build.John McCall2012-06-231-0/+5
| | | | llvm-svn: 159089
* objective-c: issue deprecation/unavailability warnings for methods called on Fariborz Jahanian2012-06-231-0/+32
| | | | | | id <Protocol>. // rdar://11618852 llvm-svn: 159084
* Add triple to test/Sema/attr-tls_model.cHans Wennborg2012-06-231-1/+1
| | | | | | Not all targets support __thread variables. llvm-svn: 159080
* Support the tls_model attribute (PR9788)Hans Wennborg2012-06-232-0/+29
| | | | | | | | | | | | | | This adds support for the tls_model attribute. This allows the user to choose a TLS model that is better than what LLVM would select by default. For example, a variable might be declared as: __thread int x __attribute__((tls_model("initial-exec"))); if it will not be used in a shared library that is dlopen'ed. This depends on LLVM r159077. llvm-svn: 159078
* Clean up a large number of C++11 attribute parse issues, including parsingAlexis Hunt2012-06-231-2/+128
| | | | | | | | | | | | | | | | | | attributes in more places where we didn't and catching a lot more issues. This implements nearly every aspect of C++11 attribute parsing, except for: - Attributes are permitted on explicit instantiations inside the declarator (but not preceding the decl-spec) - Attributes are permitted on friend declarations of functions. - Multiple instances of the same attribute in an attribute-list (e.g. [[noreturn, noreturn]], not [[noreturn]] [[noreturn]] which is conforming) are allowed. The first two are marked as expected-FIXME in the test file and the latter is probably a defect and is currently untested. Thanks to Richard Smith for providing the lion's share of the testcases. llvm-svn: 159072
* [Windows] Fix mangling of repeated types in the presence of bool and ↵Timur Iskhodzhanov2012-06-231-6/+37
| | | | | | function pointers PR13176,PR13177 llvm-svn: 159059
* MicrosoftMangle: Fix mangling of integral constant non-type template ↵Charles Davis2012-06-231-0/+10
| | | | | | arguments in a class specialization. llvm-svn: 159056
* Minor improvements to some C99 variadic-macro-related diagnostics.Richard Smith2012-06-223-14/+11
| | | | llvm-svn: 159054
* Implement initial static analysis inlining support for C++ methods.Ted Kremenek2012-06-222-0/+23
| | | | llvm-svn: 159047
* Perform typo correction for base class specifiers.Kaelyn Uhrain2012-06-221-0/+8
| | | | llvm-svn: 159046
* [analyzer] Teach malloc checker that initWith[Bytes|Characters}NoCopy Anna Zaks2012-06-221-0/+10
| | | | | | relinquish memory. llvm-svn: 159043
* [analyzer] Fixup to r158958.Anna Zaks2012-06-222-0/+11
| | | | llvm-svn: 159037
* Mark Doxygen warnings DefaultIgnore.Dmitri Gribenko2012-06-221-4/+4
| | | | llvm-svn: 159026
* revert CodeGen support for the alloc_size attribute until we finish the ↵Nuno Lopes2012-06-222-29/+0
| | | | | | design of a more generic metadata node llvm-svn: 159016
* Disable llvm optimizations in a clang test.Rafael Espindola2012-06-221-2/+2
| | | | llvm-svn: 159012
* [analyzer] Check for +raise:format: on subclasses of NSException as well.Jordan Rose2012-06-221-0/+12
| | | | | | | | | | | We don't handle exceptions yet, so we treat them as sinks. ExprEngine hardcodes messages that are known to raise Objective-C exceptions like -raise, but it was only checking for +raise:format: and +raise:format:arguments: on NSException itself, not subclasses. <rdar://problem/11724201> llvm-svn: 159010
* Thread safety analysis: fixes a bug in which locksets are not handledDeLesley Hutchins2012-06-221-16/+32
| | | | | | | | properly if there is a join point in the control flow graph that involves a trylock. Also changes the source locations of some warnings to be more consistent. llvm-svn: 159008
* Show fixit for unqualified calls to methods of dependent basesNico Weber2012-06-221-2/+1
| | | | | | | | when the calling site is a member function template. Effectively reverts r111675. llvm-svn: 159004
* Add a warning about almost-Doxygen trailing comments: //< and /*< ... */Dmitri Gribenko2012-06-222-1/+15
| | | | llvm-svn: 159001
* objective-c: improve diagnostic when collection expression isFariborz Jahanian2012-06-222-6/+6
| | | | | | not a pointer to a fast-enumerable object. // rdar://11488666 llvm-svn: 158998
* [analyzer] Malloc: Warn about use-after-free when memory ownership wasAnna Zaks2012-06-222-8/+12
| | | | | | transfered with dataWithBytesNoCopy. llvm-svn: 158958
* [diagtool] Write to llvm::outs() by default instead of llvm::errs()Jordan Rose2012-06-222-7/+7
| | | | llvm-svn: 158954
* Add the testcase from pr13168.Rafael Espindola2012-06-211-0/+7
| | | | llvm-svn: 158950
* Revert r158887. This fixes pr13168.Rafael Espindola2012-06-212-71/+0
| | | | | | | | Revert "If an object (such as a std::string) with an appropriate c_str() member function" This reverts commit 7d96f6106bfbd85b1af06f34fdbf2834aad0e47e. llvm-svn: 158949
* Handle include directive with comments. It turns out that in this case ↵Dmitri Gribenko2012-06-212-0/+47
| | | | | | comments are not coming in source order. Instead of trying to std::sort() comments (which can be costly), just remove comments that are not in order. llvm-svn: 158940
* objective-c: If an ivar is (1) the first ivar in a root class and (2) named ↵Fariborz Jahanian2012-06-211-0/+48
| | | | | | | | `isa`, then it should get the same warnings that id->isa gets. // rdar://11702488 llvm-svn: 158938
* PR13165: False positive when initializing member data pointers with NULL.David Blaikie2012-06-211-0/+8
| | | | | | | | | This now correctly covers, I believe, all the pointer types: * 'any' pointers (both function and data normal pointers and ObjC object pointers) * member pointers (both function and data) * block pointers llvm-svn: 158931
* objective-c: deprecated C-like parameters in Objective-C Fariborz Jahanian2012-06-215-6/+6
| | | | | | | method declarations. // rdar://11578353. llvm-svn: 158929
* Less restrictive check in unit test for unsupported debug info optionsAlexey Samsonov2012-06-211-1/+1
| | | | llvm-svn: 158916
* Revert r158423 corresponding to r158796, "test/Driver/warning-options.cpp: ↵NAKAMURA Takumi2012-06-211-4/+0
| | | | | | Mark as XFAIL:cygming. -pedantic is passed with gcc-as driver. PR12920" llvm-svn: 158915
* Improve support for -g options accepted by Clang:Alexey Samsonov2012-06-212-36/+43
| | | | | | | | 1. Accept flags -g[0-3], -ggdb[0-3], -gdwarf-[2-4] and collapse them to simple -g (except -g0/-ggdb0). 2. Produce driver error on unsupported formats (-gcoff, -gstabs, -gvms) and options (-gtoggle). 3. Recognize and ignore flags -g[no-]strict-dwarf, -g[no-]record-gcc-switches. llvm-svn: 158906
* Pretend that enum constants have enum type when inferring a block return type.Jordan Rose2012-06-211-0/+127
| | | | | | | | | | | | In C, enum constants have the type of the enum's underlying integer type, rather than the type of the enum. (This is not true in C++.) This leads to odd warnings when returning enum constants directly in blocks with inferred return types. The easiest way out of this is to pretend that, like C++, enum constants have enum type when being returned from a block. <rdar://problem/11662489> llvm-svn: 158899
* Don't warn for -Wstatic-in-inline if the used function is also inline.Jordan Rose2012-06-211-0/+14
| | | | | | | | | | | | | | | | | | Also, don't warn if the used function is __attribute__((const)), in which case it's not supposed to use global variables anyway. The inline-in-inline thing is a heuristic, and one that's possibly incorrect fairly often because the function being inlined could definitely use global variables. However, even some C standard library functions are written using other (trivial) static-inline functions in the headers, and we definitely don't want to be warning on that (or on anything that /uses/ these trivial inline functions). So we're using "inlined" as a marker for "fairly trivial". (Note that __attribute__((pure)) does /not/ guarantee safety like ((const), because ((const)) does not guarantee that global variables are not being used, and the warning is about globals not being shared across TUs.) llvm-svn: 158898
* MS: Mangle rvalue references and nullptr_t, and produce back-references whenRichard Smith2012-06-213-0/+52
| | | | | | appropriate. Patch by João Matos! llvm-svn: 158895
* If an object (such as a std::string) with an appropriate c_str() member functionRichard Smith2012-06-212-0/+71
| | | | | | | | | | | | | | | is passed to a variadic function in a position where a format string indicates that c_str()'s return type is desired, provide a note suggesting that the user may have intended to call the c_str() member. Factor the non-POD-vararg checking out of DefaultVariadicArgumentPromotion and move it to SemaChecking in order to facilitate this. Factor the call checking out of function call checking and block call checking, and extend it to cover constructor calls too. Patch by Sam Panzer! llvm-svn: 158887
* Do not complain about junk on the end of a #endif in a skipped block. Such junkRichard Smith2012-06-211-0/+27
| | | | | | is permitted by all relevant language standards. Patch by Andy Gibbs! llvm-svn: 158883
* [analyzer] Malloc leak false positive: Allow xpc context to escape.Anna Zaks2012-06-202-0/+20
| | | | llvm-svn: 158875
* objective-c: place quotes around named items in a diagnostic.Fariborz Jahanian2012-06-201-2/+2
| | | | | | // rdar://11671080 llvm-svn: 158874
* objc: tweak my last patch to warn if class extensionFariborz Jahanian2012-06-201-0/+4
| | | | | | has not overridden the property. // rdar://11656982 llvm-svn: 158871
* objective-c: Normally, a property cannot be both 'readonly' and having a Fariborz Jahanian2012-06-202-0/+78
| | | | | | | | | | "write" attribute (copy/retain/etc.). But, property declaration in primary class and protcols are tentative as they may be overridden into a 'readwrite' property in class extensions. Postpone diagnosing such warnings until the class implementation is seen. // rdar://11656982 llvm-svn: 158869
* Added test with sizeof conditions (relies on to-be-implemented functionality ↵Alexander Kornienko2012-06-201-0/+18
| | | | | | of CFG, discussion: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120507/057370.html) llvm-svn: 158854
* Reword -Winternal-linkage-in-inline, and rename it to -Wstatic-in-inline.Jordan Rose2012-06-201-8/+10
| | | | | | | | | Now that this is a C-only warning, we can use "static" instead of "internal linkage", which is a term developers are probably more familiar with. This makes for a better warning message. The warning name was changed to match, since "internal linkage" is not mentioned in the warning text anymore. llvm-svn: 158853
* [analyzer] Malloc: cleanup, disallow free on relinquished memory.Anna Zaks2012-06-201-3/+3
| | | | | | | | This commits sets the grounds for more aggressive use after free checking. We will use the Relinquished sate to denote that someone else is now responsible for releasing the memory. llvm-svn: 158850
OpenPOWER on IntegriCloud