summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve parsing and instantiation of destructor names, so that we canDouglas Gregor2010-02-165-77/+341
| | | | | | | | | | | | | | | | | | | | | | | now cope with the destruction of types named as dependent templates, e.g., y->template Y<T>::~Y() Nominally, we implement C++0x [basic.lookup.qual]p6. However, we don't follow the letter of the standard here because that would fail to parse template<typename T, typename U> X0<T, U>::~X0() { } properly. The problem is captured in core issue 339, which gives some (but not enough!) guidance. I expect to revisit this code when the resolution of 339 is clear, and/or we start capturing better source information for DeclarationNames. Fixes PR6152. llvm-svn: 96367
* dllimport and dllexport are declspec attributes, too. They're alsoCharles Davis2010-02-162-80/+95
| | | | | | | | Win32-specific. Also, fix a test to use FileCheck instead of grepping LLVM IR. llvm-svn: 96364
* Rename argument so the name reflects what it's doing.Benjamin Kramer2010-02-162-9/+10
| | | | llvm-svn: 96342
* Support local namespace aliases and permit them to be instantiated.John McCall2010-02-162-1/+17
| | | | llvm-svn: 96335
* Refactor the logic for printf argument type-checking into ↵Ted Kremenek2010-02-161-100/+59
| | | | | | | | | | analyze_printf::ArgTypeResult. Implement printf argument type checking for '%s'. Fixes <rdar://problem/3065808>. llvm-svn: 96310
* Add Sema support for __builtin_fpclassify by extending the existing check ↵Benjamin Kramer2010-02-152-10/+15
| | | | | | for __builtin_isinf and friends. Part of PR6083. llvm-svn: 96291
* Fix instantiation of template functions with local classes that contain virtualChandler Carruth2010-02-151-1/+10
| | | | | | methods. llvm-svn: 96283
* Class continuation now has its own property ast forFariborz Jahanian2010-02-151-53/+87
| | | | | | | | those declared in it. This is to allow duplicate property diagnostics for properties declared in class extensions multiple times (radar 7629420) and for future use. llvm-svn: 96276
* Optimize the implementation of IdDeclInfo pooling in the IdentifierResolver.John McCall2010-02-151-13/+25
| | | | llvm-svn: 96253
* Defer covariance checks for dependent types. Add test cases that also ensureChandler Carruth2010-02-151-1/+2
| | | | | | they are re-checked on instantiation. llvm-svn: 96217
* Skip implicit instantiation of templated variables where a more recentChandler Carruth2010-02-131-0/+18
| | | | | | redeclaration provides an explicit instantiation or is invalid. llvm-svn: 96097
* Silence a GCC warning about a possibly uninitialized variable. It's data flowChandler Carruth2010-02-131-1/+1
| | | | | | only flows so far it seems. llvm-svn: 96085
* Fix a fiendinshly fun little type-canonicalization bug, where we wereDouglas Gregor2010-02-131-2/+6
| | | | | | | | | rebuilding a typename type terminating in a template-id (with dependent template name, naturally) as a TypenameType when, because its context could be fully resolved, we should have been building it as a QualifiedNameType. Fixes PR6268. llvm-svn: 96084
* Permit the use of typedefs of class template specializations inDouglas Gregor2010-02-131-10/+6
| | | | | | | qualified declarator-ids. This patch is actually due to Cornelius; fixes PR6179. llvm-svn: 96082
* Complain if block-literal expression's parameter name isFariborz Jahanian2010-02-122-2/+10
| | | | | | missing (in c/objc mode). Fixes radar 7528255. llvm-svn: 96017
* Improve representation of tag declarations first declared or definedDouglas Gregor2010-02-121-1/+4
| | | | | | within the declarator of another declaration, from Enea Zaffanella! llvm-svn: 95991
* Work around an annoying, non-standard optimization in the glibcDouglas Gregor2010-02-123-6/+67
| | | | | | | | | | | | | | | | | | | | | | headers, where malloc (and many other libc functions) are declared with empty throw specifications, e.g., extern void *malloc (__SIZE_TYPE__ __size) throw () __attribute__ ((__malloc__)) ; The C++ standard doesn't seem to allow this, and redeclaring malloc as the standard permits (as follows) resulted in Clang (rightfully!) complaining about mis-matched exception specifications. void *malloc(size_t size); We work around this by silently propagating an empty throw specification "throw()" from a function with C linkage declared in a system header to a redeclaration that has no throw specifier. Ick. llvm-svn: 95969
* In C++, allow builtins to be referred to via qualified name lookup, e.g.,Douglas Gregor2010-02-122-30/+48
| | | | | | | | ::__builtin_va_copy Fixes one of the Firefox issues in PR5511. llvm-svn: 95966
* Waste two bits in every clang::Type so that the type class can be readJohn McCall2010-02-121-1/+1
| | | | | | in a single byte-load rather than some crazy bitmunging operation. llvm-svn: 95964
* 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
OpenPOWER on IntegriCloud