summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Implementing unused function warning.Tanya Lattner2010-02-124-0/+28
| | | | llvm-svn: 95940
* Warn about using the new force_align_arg_pointer attribute on a functionCharles Davis2010-02-111-4/+6
| | | | | | | pointer. If you don't like the new warning, you can turn it off with -Wno-force-align-arg-pointer. llvm-svn: 95939
* When we have a dependent direct initializer but not a dependentDouglas Gregor2010-02-112-18/+27
| | | | | | | | variable type, we can (and should) still check for completeness of the variable's type. Do so, to work around an assertion that shows up in Boost's shared_ptr. llvm-svn: 95934
* Fix leak in CXXNewExpr where the SubExprs array would get allocated directly ↵Ted Kremenek2010-02-111-4/+7
| | | | | | using 'new[]' instead of the allocator associated with ASTContext. llvm-svn: 95933
* Allocate the SubExprs array in ObjCMessageExpr using the allocator ↵Ted Kremenek2010-02-112-13/+18
| | | | | | associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>). llvm-svn: 95930
* Uncomment lines I never meant to have left commented in a commit.Ted Kremenek2010-02-111-3/+3
| | | | llvm-svn: 95906
* More vtable layout dumper improvements. Handle destructors, dump the ↵Anders Carlsson2010-02-112-4/+2
| | | | | | complete function type of the member functions (using PredefinedExpr::ComputeName. llvm-svn: 95887
* Patch by Cristian Draghici:Ted Kremenek2010-02-111-2/+34
| | | | | | | | | | | | Enhance the printf format string checking when using the format specifier flags ' ', '0', '+' with the 'p' or 's' conversions (since they are nonsensical and undefined). This is similar to GCC's checking. Also warning when a precision is used with the 'p' conversin specifier, since it has no meaning. llvm-svn: 95869
* Use the allocator associated with ASTContext to allocate the argsTed Kremenek2010-02-111-1/+1
| | | | | | | | array associated with NonNullAttr. This fixes yet another leak when ASTContext uses a BumpPtrAllocator. Fixes: <rdar://problem/7637150> llvm-svn: 95863
* Remove use of 'std::string' from Attr objects, using instead a byteTed Kremenek2010-02-112-12/+12
| | | | | | | | | array allocated using the allocator in ASTContext. This addresses these strings getting leaked when using a BumpPtrAllocator (in ASTContext). Fixes: <rdar://problem/7636765> llvm-svn: 95853
* Strip attributes and 'inline' off the "previous declaration" of aJohn McCall2010-02-111-15/+27
| | | | | | | template explicit specialization. Complete an apparently stalled refactor towards using CheckSpecializationInstantiationRedecl(). llvm-svn: 95845
* Remove another redundant ASTContext parameterDouglas Gregor2010-02-111-1/+1
| | | | llvm-svn: 95843
* Eliminate a bunch of unnecessary ASTContexts from members functions ofDouglas Gregor2010-02-116-26/+21
| | | | | | Decl subclasses. No functionality change. llvm-svn: 95841
* Diagnose when user provided getter is being used as lvalueFariborz Jahanian2010-02-111-0/+3
| | | | | | using property dot-syntax. Fixes radar 7628953. llvm-svn: 95838
* Eliminate the ASTContext parameter from RecordDecl::getDefinition()Douglas Gregor2010-02-116-17/+17
| | | | | | | and CXXRecordDecl::getDefinition(); it's totally unnecessary. No functionality change. llvm-svn: 95836
* Allocate 'ObjCMethodList' objects (owned by Sema) using Sema's ↵Ted Kremenek2010-02-111-2/+4
| | | | | | BumpPtrAllocator. Previously they were not getting freed. Fixes <rdar://problem/7635663>. llvm-svn: 95834
* Fix a potential null-pointer use, and fix the style of my new function.Charles Davis2010-02-101-2/+2
| | | | | | Thanks, Anton! llvm-svn: 95821
* Add support for the force_align_arg_pointer attribute. This is an x86-specificCharles Davis2010-02-101-0/+42
| | | | | | | | attribute, so it uses Anton's new target-specific attribute support. It's supposed to ensure that the stack is 16-byte aligned, but since necessary support is lacking from LLVM, this is a no-op for now. llvm-svn: 95820
* Improve access control diagnostics. Perform access control on member-pointerJohn McCall2010-02-108-293/+555
| | | | | | | conversions. Fix an access-control bug where privileges were not considered at intermediate points along the inheritance path. Prepare for friends. llvm-svn: 95775
* Convert tabs to spaces.Ted Kremenek2010-02-101-12/+12
| | | | llvm-svn: 95756
* Move the diagnostic argument formatting function out of Sema and makeDouglas Gregor2010-02-091-245/+3
| | | | | | | it available within the AST library, of which Sema is one client. No functionality change. llvm-svn: 95701
* Finish implementing property synthesis by default.Fariborz Jahanian2010-02-093-15/+27
| | | | | | (radar 7381956). llvm-svn: 95695
* Implement synthesizing properties by default.Fariborz Jahanian2010-02-093-3/+73
| | | | | | | | | This is a non-fragile-abi feature only. Since it breaks existing code, it is currently placed under -fobjc-nonfragile-abi2 option for test purposes only until further notice. WIP. llvm-svn: 95685
* Migrate the mish-mash of declaration checks inDouglas Gregor2010-02-093-177/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sema::ActOnUninitializedDecl over to InitializationSequence (with default initialization), eliminating redundancy. More importantly, we now check that a const definition in C++ has an initilizer, which was an #if 0'd code for many, many months. A few other tweaks were needed to get everything working again: - Fix all of the places in the testsuite where we defined const objects without initializers (now that we diagnose this issue) - Teach instantiation of static data members to find the previous declaration, so that we build proper redeclaration chains. Previously, we had the redeclaration chain but built it too late to be useful, because... - Teach instantiation of static data member definitions not to try to check an initializer if a previous declaration already had an initializer. This makes sure that we don't complain about static const data members with in-class initializers and out-of-line definitions. - Move all of the incomplete-type checking logic out of Sema::FinalizeDeclaratorGroup; it makes more sense in ActOnUnitializedDecl. There may still be a few places where we can improve these diagnostics. I'll address that as a separate commit. llvm-svn: 95657
* Be more careful when checking initializer lists that involve referenceDouglas Gregor2010-02-091-3/+3
| | | | | | types; we don't want to give an expression reference type. Fixes PR6177. llvm-svn: 95635
* Implement a specific diagnostic when a class template partialDouglas Gregor2010-02-091-9/+20
| | | | | | | specialization does not use any of its template parameters, then recover far more gracefully. Fixes PR6181. llvm-svn: 95629
* When substituting a declaration non-type template argument for aDouglas Gregor2010-02-081-8/+14
| | | | | | | | non-type template parameter that has reference type, augment the qualifiers of the non-type template argument with those of the referenced type. Fixes PR6250. llvm-svn: 95607
* Thread a source location into the template-argument deduction routines. ThereJohn McCall2010-02-0811-60/+99
| | | | | | | may be some other places that could take advantage of this new information, but I haven't really looked yet. llvm-svn: 95600
* Warn when cases are missing from a switch on a value of enumerationDouglas Gregor2010-02-081-1/+87
| | | | | | type (-Wswitch), from Michal! llvm-svn: 95592
* Keep track of whether a tag was defined in a declarator vs. beingDouglas Gregor2010-02-081-2/+5
| | | | | | defined by itself, from Enea Zaffanella! llvm-svn: 95586
* Fix the crash-on-invalid from PR6259.John McCall2010-02-081-1/+7
| | | | llvm-svn: 95554
* This doesn't seem to be used code as it didn't break any tests, but fix theChandler Carruth2010-02-081-1/+1
| | | | | | glaring logic bug anyways. =D llvm-svn: 95533
* Require a complete type before examining base classes during template argumentChandler Carruth2010-02-071-72/+80
| | | | | | | | | | deduction. This requires refactoring the deduction to have access to the Sema object instead of merely the ASTContext. Still leaves something to be desired due to poor source location. Fixes PR6257 and half of PR6259. llvm-svn: 95528
* Workaround for friend template instantiation crash in PR5848, from Keir Mierle!Douglas Gregor2010-02-071-3/+11
| | | | llvm-svn: 95517
* Add attributes to namespace decls.Anders Carlsson2010-02-072-2/+6
| | | | llvm-svn: 95510
* Add support for threadsafe statics, and make them the default (matching gcc).Anders Carlsson2010-02-061-1/+1
| | | | | | Daniel, I'd appreciate a review of the driver/cc1 parts. llvm-svn: 95508
* Use a substituted type when determining how to substitute in non-type templateJohn McCall2010-02-061-35/+32
| | | | | | | | | | | params. Don't insert addrof operations when matching against a pointer; array/function conversions should take care of this for us, assuming the argument type-checked in the first place. Add a fixme where we seem to be using a less-restrictive reference type than we should. Fixes PR 6249. llvm-svn: 95495
* Silence GCC warning and stay in 80 cols.Benjamin Kramer2010-02-061-4/+5
| | | | llvm-svn: 95494
* Extract a function to instantiate references to value template parameters.John McCall2010-02-061-109/+116
| | | | llvm-svn: 95491
* Don't diagnose missing noreturns for uninstantiated templates. Fixes PR6247.Anders Carlsson2010-02-061-3/+4
| | | | llvm-svn: 95487
* Implement a warning diagnostic for weak vtables. Fixes PR6116.Anders Carlsson2010-02-061-2/+9
| | | | llvm-svn: 95472
* Teach Sema how to instantiate a local function declaration properly. FixesJohn McCall2010-02-061-3/+8
| | | | | | PR 5517. llvm-svn: 95470
* Fix a bogus assertion after adjusting the type of a substitutedDouglas Gregor2010-02-051-1/+3
| | | | | | | non-type template argument for a non-type template parameter of pointer type. Fixes PR6244. llvm-svn: 95447
* Cope with finding the "instantiated" declaration when we areDouglas Gregor2010-02-051-21/+36
| | | | | | | | type-checking within a template definition. In this case, the "instantiated" declaration is just the declaration itself, found within the current instantiation. Fixes PR6239. llvm-svn: 95442
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-056-228/+172
| | | | | | | | | | | | follows (as conservatively as possible) gcc's current behavior: attributes written on return types that don't apply there are applied to the function instead, etc. Only parse CC attributes as type attributes, not as decl attributes; don't accepet noreturn as a decl attribute on ValueDecls, either (it still needs to apply to other decls, like blocks). Consistently consume CC/noreturn information throughout codegen; enforce this by removing their default values in CodeGenTypes::getFunctionInfo(). llvm-svn: 95436
* Fix two issues with the substitution of template template parametersDouglas Gregor2010-02-052-9/+9
| | | | | | | | | | | | | | | | when instantiating the declaration of a member template: - Only check if the have a template template argument at a specific position when we already know that we have template arguments at that level; otherwise, we're substituting for a level-reduced template template parameter. - When trying to find an instantiated declaration for a template template parameter, look into the instantiated scope. This was a typo, where we had two checks for TemplateTypeParmDecl, one of which should have been a TemplateTemplateParmDecl. With these changes, tramp3d-v4 passes -fsyntax-only. llvm-svn: 95421
* When we're parsing an expression that may have looked like aDouglas Gregor2010-02-051-1/+3
| | | | | | | | | declaration, we can end up with template-id annotation tokens for types that have not been converted into type annotation tokens. When this is the case, translate the template-id into a type and parse as an expression. llvm-svn: 95404
* Testing, 1, 2, 3...Charles Davis2010-02-051-2/+4
| | | | | | Also make the comments I added in r95291 consistent. llvm-svn: 95394
* A dependent initializer with zero arguments should return a NULLDouglas Gregor2010-02-052-1/+5
| | | | | | | initializer (for no initialization) rather than a ParenListExpr with zero arguments in it. llvm-svn: 95382
* Default function arguments for function template specializationsDouglas Gregor2010-02-053-5/+16
| | | | | | | always come from the primary template, so gather the instantiation template arguments from the primary template. llvm-svn: 95380
OpenPOWER on IntegriCloud