summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix more try scoping bugs introduced by r167650.David Blaikie2012-11-121-8/+5
| | | | | | | Introduces more clear scoping flags & flag combinations which should hopefully be more understandable. llvm-svn: 167766
* Don't test for incomplete types.Bill Wendling2012-11-121-3/+0
| | | | llvm-svn: 167761
* Per discussion on cfe-dev, re-enable suppression of -Wimplicit-fallthrough ↵Ted Kremenek2012-11-121-0/+12
| | | | | | | | | | | | | | on C, but also include dialects of C++ earlier than C++11. There was enough consensus that we *can* get a good language solution to have an annotation outside of C++11, and without this annotation this warning doesn't quite mean's completeness criteria for this kind of warning. For now, restrict this warning to C++11 (where an annotation exists), and make this the behavior for the LLVM 3.2 release. Afterwards, we will hammer out a language solution that we are all happy with. llvm-svn: 167749
* Check that the input size is correct for the given constraint.Bill Wendling2012-11-121-0/+11
| | | | | | | | | The 'a', 'c', and 'd' constraints on i386 mean a 32-bit register. We cannot place a 64-bit value into the 32-bit register. Error out instead of causing the compiler to spew general badness. <rdar://problem/12415959> llvm-svn: 167717
* Rework my implementation of circular-reference finding to not useDouglas Gregor2012-11-101-7/+34
| | | | | | | CXXRecordDecl::forallBases, which does *not* do what I need. Fixes the failure introduced in r167651. llvm-svn: 167668
* Revert "Disable -Wimplicit-fallthrough when not using C++.", pending further ↵Ted Kremenek2012-11-101-13/+0
| | | | | | discussion on cfe-dev. llvm-svn: 167662
* Disable -Wimplicit-fallthrough when not using C++.Ted Kremenek2012-11-101-0/+13
| | | | | | | | | | | | | | | The rationale is that there is no good workflow to silence the warning for specific cases, other than using pragmas. This is because the attribute to decorate an explicit fall through is only available in C++11. By that argument, this should probably also be disabled unless one is using C++11, but apparently there is an explicit test case for this warning when using C++98. This will require further discussion on cfe-commits. Fixes: <rdar://problem/12584746> llvm-svn: 167655
* Handle redeclarations of catch variables in catch blocks.David Blaikie2012-11-101-1/+4
| | | | | | Fix to regression caused by r167650, caught by Richard Smith in code review. llvm-svn: 167653
* Diagnostic circular inheritance involving dependent base classes. WeDouglas Gregor2012-11-101-4/+31
| | | | | | | would have diagnosed this at instantiation time anyway, if only we didn't hang on all of these test cases. Fixes <rdar://problem/12629723> llvm-svn: 167651
* PR14296: function parameter name collisions in function try/catchDavid Blaikie2012-11-101-1/+6
| | | | | | | | | | | | C++11 3.3.3/2 "A parameter name shall not be redeclared in the outermost block of the function definition nor in the outermost block of any handler associated with a function-try-block." It's not totally clear to me whether the "FIXME" case is covered by this, but Richard Smith thinks it probably should be. It's just a bit more involved to fix that case. llvm-svn: 167650
* -Wobjc-literal-compare: look through implicit casts.Jordan Rose2012-11-091-1/+2
| | | | | | | | | This warning was failing to fire under ARC because of the implicit lifetime casts added around the object literal expression. <rdar://problem/11300873>, again. llvm-svn: 167648
* PR13788: Don't perform checks on the initializer of a dependently-typedRichard Smith2012-11-091-4/+3
| | | | | | | | | variable. Previously we didn't notice the type was dependent if the only dependence came from an array bound. Patch by Brian Brooks! llvm-svn: 167642
* Use isInvalidDecl() instead of isStatic() as suggested by dblaikie.Nico Weber2012-11-091-1/+1
| | | | | | | I couldn't think of a way to make an operator() invalid without returning earlier from this function other than making it static, so no new test. llvm-svn: 167609
* Don't crash on calling static member overloaded operator, PR14120Nico Weber2012-11-091-0/+5
| | | | | | Patch from Brian Brooks! llvm-svn: 167604
* Fix a bug I found while preparing my devmtg talk: When passing NULL to aMatt Beaumont-Gay2012-11-081-2/+12
| | | | | | | | | | | | function that takes a const Foo&, where Foo is convertible from a large number of pointer types, we print ALL the overloads, no matter the setting of -fshow-overloads. There is potential follow-on work in unifying the "print candidates, but not too many" logic between OverloadCandidateSet::NoteCandidates and ImplicitConversionSequence::DiagnoseAmbiguousConversion. llvm-svn: 167596
* Avoid to write function name in comment. Thanks to Dmitri Gribenko.Abramo Bagnara2012-11-081-7/+6
| | | | llvm-svn: 167588
* Readded line removed by mistake.Abramo Bagnara2012-11-081-0/+1
| | | | llvm-svn: 167587
* Fixed converted ConstantArrayTypeLoc range. Added a missing testcase for ↵Abramo Bagnara2012-11-081-19/+71
| | | | | | ConstructorDecl source range. llvm-svn: 167583
* PR14284: crash on ext-valid returning NULL from a void functionDavid Blaikie2012-11-081-1/+2
| | | | llvm-svn: 167565
* Reduce nesting. No functionality change.Nico Weber2012-11-071-12/+14
| | | | llvm-svn: 167551
* When template deduction fails on a derived class, try a template deduction onRichard Trieu2012-11-071-1/+6
| | | | | | | | | | the base class. If the base class deduction succeeds, use those results. If it fails, keep using the results from the derived class template deduction. This prevents an assertion later where the type of deduction failure doesn't match up with the template deduction info. llvm-svn: 167550
* PR11851 (and duplicates): Whenever a constexpr function is referenced,Richard Smith2012-11-072-18/+38
| | | | | | | | | instantiate it if it can be instantiated and implicitly define it if it can be implicitly defined. This matches g++'s approach. Remove some cases from SemaOverload which were marking functions as referenced when just planning how overload resolution would proceed; such cases are not actually references. llvm-svn: 167514
* Add missing check to warning for packed attribute. PR14259.Eli Friedman2012-11-071-1/+2
| | | | llvm-svn: 167510
* PR13552: Fix the end location of a CXXNewExpr.David Blaikie2012-11-071-3/+4
| | | | | | | | | Spent longer than reasonable looking for a nice way to test this & decided to give up for now. Open to suggestions/requests. Richard Smith suggested adding something to ASTMatchers but it wasn't readily apparent how to test this with that. llvm-svn: 167507
* Fix assertion failure with auto and nested initializer list; PR14272.Eli Friedman2012-11-061-2/+3
| | | | llvm-svn: 167506
* Put the usage-directive inside the nearest namespace or TU decl. We don't wantNick Lewycky2012-11-041-3/+3
| | | | | | | | to have UsingDirectiveDecl inside anything other than those two. No user-visible functionality change. llvm-svn: 167376
* Address review comments for r167358: explicitly check for CK_BitCast instead ofDmitri Gribenko2012-11-031-2/+1
| | | | | | checking against a blacklist. llvm-svn: 167362
* Handle CK_NullToPointer casts in -Wtype-safety properly. Fixes PR14249.Dmitri Gribenko2012-11-031-1/+3
| | | | llvm-svn: 167358
* Update the front end to use minsize attributeQuentin Colombet2012-11-011-0/+17
| | | | llvm-svn: 167266
* Correctly reject gotos in function-level try blocks. PR14225.Eli Friedman2012-10-311-24/+23
| | | | llvm-svn: 167184
* Address Jordan's review: comments, spaces.Anna Zaks2012-10-311-3/+3
| | | | llvm-svn: 167091
* Revert commit r166946Quentin Colombet2012-10-291-17/+0
| | | | llvm-svn: 166957
* Partially roll back r166898; it exposed a bug in the standard.Richard Smith2012-10-291-1/+2
| | | | | | | | | | | | | The problem is as follows: C++11 has contexts which are not potentially-evaluated, and yet in which we are required or encouraged to perform constant evaluation. In such contexts, we are not permitted to implicitly define special member functions for literal types, therefore we cannot evalaute those constant expressions. Punt on this in one more context for now by skipping checking constexpr variable initializers if they occur in dependent contexts. llvm-svn: 166956
* Make forcesizeopt attribute available to the end userQuentin Colombet2012-10-291-0/+17
| | | | llvm-svn: 166946
* -Warc-repeated-use-of-weak: allow single reads in loops from local variables.Jordan Rose2012-10-291-5/+30
| | | | | | | | | | | | | | | | | | | | | Previously, the warning would erroneously fire on this: for (Test *a in someArray) use(a.weakProp); ...because it looks like the same property is being accessed over and over. However, clearly this is not the case. We now ignore loops like this for local variables, but continue to warn if the base object is a parameter, global variable, or instance variable, on the assumption that these are not repeatedly usually assigned to within loops. Additionally, do-while loops where the condition is 'false' are not really loops at all; usually they're just used for semicolon-swallowing macros or using "break" like "goto". <rdar://problem/12578785&12578849> llvm-svn: 166942
* Revert functional part of r166896 and just suppress ↵Richard Smith2012-10-281-8/+7
| | | | | | -Wunneeded-internal-declaration for reference types for now. This needs more work; the cases we currently miss are a bit random. llvm-svn: 166899
* When determining whether to try evaluating the initializer of a variable, checkRichard Smith2012-10-281-1/+1
| | | | | | | | | whether the initializer is value-dependent rather than whether we are in a dependent context. This allows us to detect some errors sooner, and fixes a crash-on-invalid if a dependent type leaks out to a non-dependent context in error recovery. llvm-svn: 166898
* In -Wunneeded-internal-declaration, suppress the warning for variables whichRichard Smith2012-10-281-1/+8
| | | | | | | | might have been used in constant expressions, rather than suppressing it for variables which are const. The important thing here is that such variables can have their values used without actually being marked as 'used'. llvm-svn: 166896
* Fix invalid jump scopes again. This time without trying to find out if anRafael Espindola2012-10-281-35/+45
| | | | | | incomplete type has a destructor or not. llvm-svn: 166895
* Revert 166876 while I debug a bootstrap problem.Rafael Espindola2012-10-271-45/+35
| | | | llvm-svn: 166878
* Reapply 166855 with an early exit on null QualTypes.Rafael Espindola2012-10-271-35/+45
| | | | llvm-svn: 166876
* Revert r166855. I can reproduce the bootstrap failure and have a testcaseRafael Espindola2012-10-271-41/+35
| | | | | | to reduce. llvm-svn: 166863
* Fix cases where we were not producing an error when a computed goto couldRafael Espindola2012-10-271-35/+41
| | | | | | | jump over destructor calls. Fixes pr13812. llvm-svn: 166855
* Recommit Eric's code to validate ASM string's constraints and modifiers.Bill Wendling2012-10-251-0/+48
| | | | | | | | | | | | | This code checks the ASM string to see if the output size is able to fit within the variable specified as the output. For instance, scalar-to-vector conversions may not really work. It's on by default, but can be turned off with a flag if you think you know what you're doing. This is placed under a flag ('-Wasm-operand-widths') and flag group ('-Wasm'). <rdar://problem/12284092> llvm-svn: 166737
* [ms-inline asm] Add support for field lookup in the SemaCallback. Patch by Eli.Chad Rosier2012-10-251-0/+50
| | | | llvm-svn: 166723
* Revert r166647 to rethink the patch...Bill Wendling2012-10-251-48/+0
| | | | llvm-svn: 166655
* Add some support for diagnosing possibly mismatched constraint, type size andBill Wendling2012-10-251-0/+48
| | | | | | | modifiers. (From an idea by Eric...) <rdar://problem/12284092> llvm-svn: 166647
* PR14171: Don't crash if we hit one of the paths where GetFullTypeForDeclaratorRichard Smith2012-10-241-0/+15
| | | | | | rebuilds a function type, and that function type has parens around its name. llvm-svn: 166644
* Fix false positive in -Wunused-variable when a ctor call make involve cleanups.David Blaikie2012-10-241-0/+2
| | | | llvm-svn: 166625
* Use a .def file for most of the diagnostic options.Douglas Gregor2012-10-232-5/+3
| | | | llvm-svn: 166520
OpenPOWER on IntegriCloud