summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* A couple minor fixes to template instantiation for for-range loops.Eli Friedman2012-01-311-0/+8
| | | | llvm-svn: 149440
* Revert r149359. This was a hack to a problem with an easy workaround, and ↵Ted Kremenek2012-01-311-14/+4
| | | | | | it doesn't feel like general solution. llvm-svn: 149404
* FormatCheckers should emit all diagnostics using EmitFormatDiagnostic().Jean-Daniel Dupas2012-01-311-15/+21
| | | | llvm-svn: 149394
* Don't warn about -Wshorten-64-to-32 in unreachable code. Fixes ↵Ted Kremenek2012-01-311-4/+14
| | | | | | <rdar://problem/10759934>. Apparently this is a common idiom in Linux (among other places). llvm-svn: 149359
* Make a bunch of local functions 'static'.Ted Kremenek2012-01-311-22/+23
| | | | llvm-svn: 149358
* Let %S, %ls, %C match 16bit types in NSStrings.Nico Weber2012-01-311-1/+2
| | | | | | As discussed at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120130/052200.html llvm-svn: 149325
* constexpr: disallow signed integer overflow in integral conversions in constantRichard Smith2012-01-301-4/+14
| | | | | | expressions in C++11. llvm-svn: 149286
* Disable "non literal format string" for NSString that result from a macro ↵Jean-Daniel Dupas2012-01-301-0/+7
| | | | | | | | | expansion. This is to prevent diagnostic when using NSLocalizedString or CFCopyLocalizedString macros which are usually used in place of NS and CF strings literals. llvm-svn: 149268
* SmallBitVectorize the deduced parameter set.Benjamin Kramer2012-01-303-30/+22
| | | | llvm-svn: 149253
* Update on format attribute handling.Jean-Daniel Dupas2012-01-301-58/+40
| | | | | | | - Remove the printf0 special handling as we treat it as printf anyway. - Perform basic checks (non-literal, empty) for all formats and not only printf/scanf. llvm-svn: 149236
* Implement code completion support for module import declarations, e.g.,Douglas Gregor2012-01-291-0/+52
| | | | | | | | | | | | @import <complete with module names here> or @import std.<complete with submodule names here> Addresses <rdar://problem/10710117>. llvm-svn: 149199
* Complain about attempts to use 'protected' visibility on targetsJohn McCall2012-01-291-3/+10
| | | | | | | | like Darwin that don't support it. We should also complain about invalid -fvisibility=protected, but that information doesn't seem to exist at the most appropriate time, so I've left a FIXME behind. llvm-svn: 149186
* Added source location for the template keyword in AST template-id expressions.Abramo Bagnara2012-01-2714-89/+172
| | | | llvm-svn: 149127
* Remove redundant checks.Jean-Daniel Dupas2012-01-271-2/+1
| | | | llvm-svn: 149125
* Avoid redundant NNS qualification in constructor/destructor names.Abramo Bagnara2012-01-272-10/+20
| | | | llvm-svn: 149124
* constexpr: Implement the [dcl.constexpr]p5 check for whether a constexprRichard Smith2012-01-271-0/+9
| | | | | | | function definition can produce a constant expression. This also provides the last few checks for [dcl.constexpr]p3 and [dcl.constexpr]p4. llvm-svn: 149108
* Turn off implicit truncation warning for compound assignment to bitfields; ↵Eli Friedman2012-01-261-2/+2
| | | | | | | | it might be reasonable in some cases, but it clearly doesn't make sense in some cases, like the included testcase. <rdar://problem/10238797>, part 2. llvm-svn: 149095
* Make the bitfield implicit truncation warning slightly more aggressive, and ↵Eli Friedman2012-01-261-8/+9
| | | | | | make the printed warning a bit more accurate. The new behavior matches gcc's -Wconversion. <rdar://problem/10238797>. llvm-svn: 149089
* Don't suppress access-control or invalid-type diagnostics from aJohn McCall2012-01-262-4/+8
| | | | | | | | | | | | | declarator just because we were able to build an invalid decl for it. The invalid-type diagnostics, in particular, are still useful to know, and may indicate something about why the decl is invalid. Also, recover from an illegal pointer/reference-to-unqualified-retainable type using __strong instead of __autoreleasing; in general, a random object is much more likely to be __strong, so this avoids unnecessary cascading errors in the most common case. llvm-svn: 149074
* Improve efficiency of Sema::MaybeBindToTemporary by working with thePeter Collingbourne2012-01-261-4/+19
| | | | | | | canonical type directly and adding a fast path for the common case that the type is directly a RecordType. llvm-svn: 149039
* Refactor to share code for handling return statements between lambda ↵Eli Friedman2012-01-263-59/+49
| | | | | | expressions and block literals. As it turns out, almost all the logic can be shared. llvm-svn: 149031
* Slight refactoring; catch yet another case where we were missing an ↵Eli Friedman2012-01-263-13/+11
| | | | | | lvalue-to-rvalue conversion. llvm-svn: 149003
* Don't stack-allocate an IntegerLiteral which can be referred to after the ↵Eli Friedman2012-01-251-3/+6
| | | | | | current method returns. PR11744, part 2. llvm-svn: 148995
* Fix a crash involving a multi-dimensional dependent VLA. PR11744.Eli Friedman2012-01-251-2/+6
| | | | llvm-svn: 148989
* Allow typo correction to be disabled in BuildOverloadedCallExpr variant.Kaelyn Uhrain2012-01-252-6/+28
| | | | | | | This suppresses typo correction for auto-generated call expressions such as to 'begin' or 'end' within a C++0x for-range statement. llvm-svn: 148979
* Avoid correcting unknown identifiers to types where types aren't allowed.Kaelyn Uhrain2012-01-251-2/+3
| | | | | | | | Pass a typo correction callback object from ParseCastExpr to Sema::ActOnIdExpression to be a bit more selective about what kinds of corrections will be allowed for unknown identifiers. llvm-svn: 148973
* Add custom callback object for typo correction in BuildRecoveryCallExpr.Kaelyn Uhrain2012-01-251-3/+49
| | | | | | | | | The new callback, in addition to limiting which keywords to include in the pool of typo correction candidates, also filters out non-keyword candidates that don't refer to (template) functions that accept the number of arguments that are present for the call being recovered. llvm-svn: 148962
* When we're substituting into a function parameter pack and expect toDouglas Gregor2012-01-253-15/+33
| | | | | | | get a function parameter pack (but don't due to weird substitutions), complain. Fixes the last bit of PR11848. llvm-svn: 148960
* Add support for const pointer to literal-objc string as format attribute.Jean-Daniel Dupas2012-01-251-0/+4
| | | | llvm-svn: 148948
* Fix r148920 to what I actually meant to commit.Eli Friedman2012-01-251-1/+3
| | | | llvm-svn: 148921
* Add missing check for placeholders.Eli Friedman2012-01-251-4/+10
| | | | llvm-svn: 148920
* In TreeTransform<Derived>::TransformBlockExpr, call ActOnBlockError for errors,Argyrios Kyrtzidis2012-01-251-2/+7
| | | | | | patch by Dmitri Gribenko. llvm-svn: 148915
* Fix PR11848: decree that an alias template contains an unexpanded parameter packRichard Smith2012-01-251-1/+1
| | | | | | | | | | | | | iff its substitution contains an unexpanded parameter pack. This has the effect that we now reject declarations such as this (which we used to crash when expanding): template<typename T> using Int = int; template<typename ...Ts> void f(Int<Ts> ...ints); The standard is inconsistent on how this case should be treated. llvm-svn: 148905
* Make sure we correctly treat __is_convertible_to as an unevaluated context. ↵Eli Friedman2012-01-251-2/+3
| | | | | | PR11833. llvm-svn: 148893
* Whenever Sema attempts to look in the global method pool, try to loadDouglas Gregor2012-01-251-21/+11
| | | | | | | | | additional data from the external Sema source. This properly copes with modules that are imported after we have already searched in the global method pool for a given selector. For PCH, it's a slight pessimization to be fixed soon. llvm-svn: 148891
* Add "multiple format attributes" support on block.Jean-Daniel Dupas2012-01-251-6/+6
| | | | llvm-svn: 148890
* Rework the external Sema source's ReadMethodPool() so that it doesn'tDouglas Gregor2012-01-252-28/+26
| | | | | | | return pre-built lists. Instead, it feeds the methods it deserializes to Sema so that Sema can unique them, which keeps the chains shorter. llvm-svn: 148889
* Factor out the addition of a method into the global method pool, andDouglas Gregor2012-01-251-35/+48
| | | | | | | teach it to always add the new method at the *end* of the list rather than as the second element in the list. llvm-svn: 148886
* Switch PerformImplicitConversion over to use DefaultLvalueConversion for ↵Eli Friedman2012-01-241-3/+5
| | | | | | lvalue-to-rvalue conversion. llvm-svn: 148874
* Replace a hack to handle NSLog/NSLogv in sema by declaring them as Library ↵Jean-Daniel Dupas2012-01-241-12/+9
| | | | | | Builtins. llvm-svn: 148873
* [libclang] In clang::getCursorKindForDecl() don't return "UnexposedDecl"Argyrios Kyrtzidis2012-01-241-13/+2
| | | | | | | | for forward references of classes and protocols, this breaks libclang API usage. rdar://10747438. llvm-svn: 148861
* Add a new warning, -Wover-aligned, which detects attempts to use the defaultNick Lewycky2012-01-241-0/+16
| | | | | | | allocator to construct an object which declares more alignment than the default allocator actually provides. Fixes PR9527! llvm-svn: 148857
* Small code cleanup/simplification in Sema::ClassifyName.Kaelyn Uhrain2012-01-241-7/+7
| | | | llvm-svn: 148850
* objc: Issue a generic diagnostic assigning to Fariborz Jahanian2012-01-241-6/+1
| | | | | | an objc object in any abi mode. llvm-svn: 148847
* The following patch adds __attribute__((no_address_safety_analysis)) which ↵Kostya Serebryany2012-01-242-0/+21
| | | | | | | | | | | | | | | will allow to disable address safety analysis (such as e.g. AddressSanitizer or SAFECode) for a specific function. When building with AddressSanitizer, add AddressSafety function attribute to every generated function except for those that have __attribute__((no_address_safety_analysis)). With this patch we will be able to 1. disable AddressSanitizer for a particular function 2. disable AddressSanitizer-hostile optimizations (such as some cases of load widening) when AddressSanitizer is on. llvm-svn: 148842
* Promote the extension warning for attempts to catch a reference orDouglas Gregor2012-01-241-10/+3
| | | | | | | | | | pointer to incomplete type from an ExtWarn to an error. We put the ExtWarn in place as part of a workaround for Boost (PR6527), but it (1) doesn't actually match a GCC extension and (2) has been fixed for two years in Boost, and (3) causes us to emit code that fails badly at run time, so it's a bad idea to keep it. Fixes PR11803. llvm-svn: 148838
* objc: issue error if assigning objects in fragile-abi too.Fariborz Jahanian2012-01-241-4/+8
| | | | | | // rdar://10731065 llvm-svn: 148823
* Only mark an IdentifierInfo as having changed since deserializationDouglas Gregor2012-01-241-5/+1
| | | | | | | | when it actually has changed (and not, e.g., when we've simply attached a deserialized macro definition). Good for ~1.5% reduction in module file size, mostly in the identifier table. llvm-svn: 148808
* Support decltype in member initializers.David Blaikie2012-01-241-3/+9
| | | | | | | | | | This is the last piece of N3031 (decltype in weird places) - supporting the use of decltype in a class ctor's member-initializer-list to specify the base classes to initialize. Reviewed by Richard Smith. llvm-svn: 148789
* Revert various template unreachability code I committed accidentally.David Blaikie2012-01-241-4/+5
| | | | | | r148774, r148775, r148776, r148777 llvm-svn: 148780
OpenPOWER on IntegriCloud