summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* StaticAnalyzer: Remove FixIts from PathDiagnosticPieces.Benjamin Kramer2012-02-041-17/+1
| | | | | | They were unused and pulled in Diagnostic.h for no reason. llvm-svn: 149779
* In C++11 mode, when an integral constant expression is desired and we have aRichard Smith2012-02-0422-174/+266
| | | | | | | | | | | | | | | | | | value of class type, look for a unique conversion operator converting to integral or unscoped enumeration type and use that. Implements [expr.const]p5. Sema::VerifyIntegerConstantExpression now performs the conversion and returns the converted result. Some important callers of Expr::isIntegralConstantExpr have been switched over to using it (including all of those required for C++11 conformance); this switch brings a side-benefit of improved diagnostics and, in several cases, simpler code. However, some language extensions and attributes have not been moved across and will not perform implicit conversions on constant expressions of literal class type where an ICE is required. In passing, fix static_assert to perform a contextual conversion to bool on its argument. llvm-svn: 149776
* Don't allow a value of a scoped enumeration to be used as the first bound for anRichard Smith2012-02-047-16/+36
| | | | | | | array new expression. This lays some groundwork for the implicit conversion to integral or unscoped enumeration which C++11 ICEs undergo. llvm-svn: 149772
* [analyzer] Make sure Containers OutOfBounds checker does not crash on ↵Anna Zaks2012-02-042-21/+30
| | | | | | undefined arguments, when CF functions are called with wrong number of arguments. llvm-svn: 149771
* Disallow constexpr main.Richard Smith2012-02-043-2/+15
| | | | llvm-svn: 149770
* Fix a rejects-valid in C++11: array new of a negative size, or overflowing arrayRichard Smith2012-02-044-17/+49
| | | | | | | | | | | | | | | | | new, is well-formed with defined semantics of throwing (a type which can be caught by a handler for) std::bad_array_new_length, unlike in C++98 where it is somewhere nebulous between undefined behavior and ill-formed. If the array size is an integral constant expression and satisfies one of these criteria, we would previous the array new expression, but now in C++11 mode, we merely issue a warning (the code is still rejected in C++98 mode, naturally). We don't yet implement new C++11 semantics correctly (see PR11644), but we do implement the overflow checking, and (for the default operator new) convert such expressions to an exception, so accepting such code now does not seem especially unsafe. llvm-svn: 149767
* Unbreak failing test added in r149738.Richard Smith2012-02-041-1/+1
| | | | llvm-svn: 149766
* ArrayRef goodness in MultiplexConsumer, no functionality change.Argyrios Kyrtzidis2012-02-042-3/+5
| | | | llvm-svn: 149764
* Remove unused field from FixItRecompile.Argyrios Kyrtzidis2012-02-041-2/+1
| | | | llvm-svn: 149762
* Don't warn on use of default allocator with an over-aligned type when theNick Lewycky2012-02-043-3/+23
| | | | | | allocator is given the pointer to allocate into. llvm-svn: 149760
* Fix ASTMerge tests that I broke in my previous commit.Argyrios Kyrtzidis2012-02-041-1/+1
| | | | llvm-svn: 149759
* autoconf: update config headerDylan Noblesmith2012-02-042-12/+3
| | | | | | | | Sync with the change in r149652. Also fix the comment to sync with LLVM's config.h header. llvm-svn: 149748
* [analyzer] Turn on by default two checkers:Anna Zaks2012-02-043-13/+14
| | | | | | | - osx.coreFoundation.containers.IndexOutOfBounds - osx.cocoa.SelfInit llvm-svn: 149747
* [analyzer] fixup to the previous commit.Anna Zaks2012-02-041-0/+1
| | | | llvm-svn: 149746
* [analyzer] Minor cleanups to the ObjCSelfInitChecker.Anna Zaks2012-02-044-19/+25
| | | | | | (Also renames in other ObjC checkers to create one category of checks.) llvm-svn: 149745
* Fixed some testsuite problems introduced by mySean Callanan2012-02-043-19/+10
| | | | | | last commit. Sorry for the outage. llvm-svn: 149744
* Comment mystery code.Nick Lewycky2012-02-041-0/+2
| | | | llvm-svn: 149742
* Revert r149721. chapuni tells me akyrtzi already fixed the testNico Weber2012-02-041-2/+1
| | | | | | by adding a triple, and the typedef makes things worse on windows. llvm-svn: 149740
* Use variable in place of multiple CI.getFrontendOpts() calls and use a bitArgyrios Kyrtzidis2012-02-043-12/+12
| | | | | | of ArrayRef goodness. No functionality change. llvm-svn: 149739
* New test case.Devang Patel2012-02-041-0/+12
| | | | llvm-svn: 149738
* Clang has existing support for debuggers thatSean Callanan2012-02-046-3/+36
| | | | | | | | | | | | | | | | | | | | want to provide "po"-like functionality which treats the result of an expression implicitly as "id" (if it is not otherwise known) and prints it as an Objective-C object. This has in the past been gated by the "DebuggerSupport" language option, but that is too general. Debuggers also provide other commands like "print" that do not make any assumptions about whether the object is an Objective-C object. This patch makes the assumption conditional on a new language option: DebuggerCastResultToId. I have also made corresponding modifications to the testsuite. llvm-svn: 149735
* Create new tag for the property. This is a work in progress.Devang Patel2012-02-041-1/+7
| | | | llvm-svn: 149734
* [libclang] Stick to the silly notion that a forward class/protocolArgyrios Kyrtzidis2012-02-041-0/+14
| | | | | | declaration is a reference. rdar://10749990 llvm-svn: 149733
* Suppress the used-but-not-defined warning for static data members while I ↵Eli Friedman2012-02-042-5/+10
| | | | | | look into a rather nasty bug in the new odr-use marking code. llvm-svn: 149731
* constexpr:Richard Smith2012-02-043-4/+45
| | | | | | | | | | The recent support for potential constant expressions exposed a bug in the implementation of libstdc++4.6, where numeric_limits<int>::min() is defined as (int)1 << 31, which isn't a constant expression. Disable the 'constexpr function never produces a constant expression' error inside system headers to compensate. llvm-svn: 149729
* Update tests so that they don't rely upon LLVMDebugVersion number.Devang Patel2012-02-039-14/+13
| | | | llvm-svn: 149726
* Make _mm_cmpgt_epi8 immute to -funsigned-char.Nick Lewycky2012-02-031-1/+2
| | | | llvm-svn: 149725
* Try to get test passing on windows.Nico Weber2012-02-031-2/+2
| | | | | | Idea by Jean-Daniel Dupas. llvm-svn: 149721
* Make explicit captures which cause implicit captures work correctly.Eli Friedman2012-02-034-18/+22
| | | | llvm-svn: 149719
* Implement implicit capture for lambda expressions.Eli Friedman2012-02-038-80/+182
| | | | | | Still left: explicit captures in lambdas need to cause implicit capture, and I need to take a look at the diagnostics for some cases. llvm-svn: 149718
* Make sure that the layout-override parser grabs the size, not the dataDouglas Gregor2012-02-032-14/+28
| | | | | | size. Otherwise, we can end up with bogus layouts. llvm-svn: 149703
* When a pack expansion occurs in the template argument list of an aliasDouglas Gregor2012-02-037-32/+79
| | | | | | | | template without a corresponding parameter pack, don't immediately substitute the alias template. This is under discussion in the C++ committee, and may become ill-formed, but for now we match GCC. llvm-svn: 149697
* Add a triple to test/SemaObjC/format-strings-objc.m to make it pass in ↵Argyrios Kyrtzidis2012-02-031-1/+1
| | | | | | windows hosts. llvm-svn: 149696
* Don't warn about anonymous struct/union in C11.Hans Wennborg2012-02-034-8/+31
| | | | | | Also, in C, call this a C11 extension rather than a GNU extension. llvm-svn: 149695
* Implement support for a pack expansion into a fixed-lengthDouglas Gregor2012-02-032-45/+221
| | | | | | | | | template. Such pack expansions can easily fail at template instantiation time, if the expanded parameter packs are of the wrong length. Fixes <rdar://problem/10040867>, PR9021, and the example that came up today at Going Native. llvm-svn: 149685
* [analyzer] Testing: add automated reference results reset.Anna Zaks2012-02-031-12/+70
| | | | llvm-svn: 149682
* Fix -ftrap-function fallout from llvm r145714. <rdar://problem/10799325>Bob Wilson2012-02-035-6/+9
| | | | | | | | | That llvm change removed the -trap-func backend option, so that using -ftrap-function with clang would cause the backend to complain. Fix it by adding the trap function name to the CodeGenOptions and passing it through to the TargetOptions. llvm-svn: 149679
* Change Lexer::makeFileCharRange() to have it accept a CharSourceRangeArgyrios Kyrtzidis2012-02-034-38/+52
| | | | | | | instead of a SourceRange, and handle the case where the range is a char (not token) range. llvm-svn: 149677
* Change the fixed array of FixitHints to a SmallVector to lift offArgyrios Kyrtzidis2012-02-034-44/+20
| | | | | | the limit on the number of fixits. llvm-svn: 149676
* Move isSentinelNullExpr() from Sema to ASTContext to make it more widelyArgyrios Kyrtzidis2012-02-034-20/+21
| | | | | | available. llvm-svn: 149675
* Further downgrade -Warc-bridge-casts-disallowed-in-nonarc to a warning (not ↵Ted Kremenek2012-02-032-11/+11
| | | | | | mapped to an error). We can consider mapping it back to an error later. llvm-svn: 149670
* Thread safety analysis:Richard Smith2012-02-035-96/+205
| | | | | | | | | | | | * When we detect that a CFG block has inconsistent lock sets, point the diagnostic at the location where we found the inconsistency, and point a note at somewhere the inconsistently-locked mutex was locked. * Fix the wording of the normal (non-loop, non-end-of-function) case of this diagnostic to not suggest that the mutex is going out of scope. * Fix the diagnostic emission code to keep a warning and its note together when sorting the diagnostics into source location order. llvm-svn: 149669
* Thread safety analysis: at a CFG join point between a block terminating in aRichard Smith2012-02-032-4/+56
| | | | | | | 'continue' and another block, prefer the lockset from the other block, and diagnose the 'continue' block as being the end of a loop. llvm-svn: 149666
* C++ 5.2.10p2 has a note that mentions that, subject to all other restrictions,Chad Rosier2012-02-032-16/+39
| | | | | | | | a cast to the same type is allowed so long as it does not cast away constness. Fix for PR11747. Patch by Aaron Ballman. Reviewed by Eli. llvm-svn: 149664
* Refactor capture in blocks to use new-style capture hooks. Start adding a ↵Eli Friedman2012-02-031-256/+195
| | | | | | bit of the code for lambdas. The only visible changes are that we use the C++11 odr-used rules to figure out when a variable is captured, and type-checking in lambdas is slightly more accurate. llvm-svn: 149663
* [frontend] Don't allow a mapping to a warning override an error/fatal mapping.Chad Rosier2012-02-036-6/+13
| | | | | | rdar://10736625 llvm-svn: 149662
* Note whether a lambda is mutable in the LambdaScopeInfo; this information ↵Eli Friedman2012-02-032-1/+5
| | | | | | will be necessary to handle references to captured variables. llvm-svn: 149660
* Make error about using bridge casts in non-ARC mode a warning that is ↵Ted Kremenek2012-02-032-2/+11
| | | | | | default mapped to an error. This is to ease the transition of large apps moving from non-ARC to ARC. llvm-svn: 149659
* Do not show macro expansion in strncat warnings, which can be defined asAnna Zaks2012-02-032-8/+28
| | | | | | a builtin. llvm-svn: 149657
* objc: Issue diagnostic when receiver type is a forward class declaration andFariborz Jahanian2012-02-033-1/+29
| | | | | | | it is treated as of 'id' type resulting in multiple method lookup. // rdar://10686120 llvm-svn: 149653
OpenPOWER on IntegriCloud