summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Let using directives refer to namespace aliases. Fixes PR5479.Sebastian Redl2009-11-231-1/+12
| | | | llvm-svn: 89657
* "Incremental" progress on using expressions, by which I mean totally rippingJohn McCall2009-11-211-21/+12
| | | | | | | | | | | | | | | | | | | | | | into pretty much everything about overload resolution in order to wean BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the idea of a non-member lookup that we haven't totally resolved yet, whether by overloading, argument-dependent lookup, or (eventually) the presence of a function template in the lookup results. Incidentally fixes a problem with argument-dependent lookup where we were still performing ADL even when the lookup results contained something from a block scope. Incidentally improves a diagnostic when using an ObjC ivar from a class method. This just fell out from rewriting BuildDeclarationNameExpr's interaction with lookup, and I'm too apathetic to break it out. The only remaining uses of OverloadedFunctionDecl that I know of are in TemplateName and MemberExpr. llvm-svn: 89544
* Incremental progress on using declarations. Split UnresolvedUsingDecl intoJohn McCall2009-11-181-9/+24
| | | | | | | | | | two classes, one for typenames and one for values; this seems to have some support from Doug if not necessarily from the extremely-vague-on-this-point standard. Track the location of the 'typename' keyword in a using-typename decl. Make a new lookup result for unresolved values and deal with it in most places. llvm-svn: 89184
* Instead of hanging a using declaration's target decls directly off the using John McCall2009-11-171-5/+4
| | | | | | | decl, create shadow declarations and put them in scope like normal. Work in progress. llvm-svn: 89048
* Unify the way destructor epilogues are generated for synthesized and regular ↵Anders Carlsson2009-11-171-6/+0
| | | | | | destructors. Also fix PR5529. llvm-svn: 89034
* First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor2009-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) llvm-svn: 88969
* If we attempt to add a constructor template specialization that looksDouglas Gregor2009-11-141-0/+27
| | | | | | | | | | | | like a copy constructor to the overload set, just ignore it. This ensures that we don't try to use such a constructor as a copy constructor *without* triggering diagnostics at the point of declaration. Note that we *do* diagnose such copy constructors when explicitly written by the user (e.g., as an explicit specialization). llvm-svn: 88733
* Revert r88718, which does NOT solve the ↵Douglas Gregor2009-11-131-8/+8
| | | | | | constructor-template-as-copy-constructor issue. Big thanks to John for finding this llvm-svn: 88724
* A constructor template cannot be instantiated to a copyDouglas Gregor2009-11-131-8/+8
| | | | | | constructor. Make sure that such declarations can never be formed. llvm-svn: 88718
* Make sure isCopyAssignment is only true for actual copy assignment operators,Eli Friedman2009-11-071-0/+3
| | | | | | | | instead of all assignment operators. The mistake messes up IRGen because it ends up assuming that the assignment operator is actually the implicit copy assignment operator, and therefore tries to emit the RHS as an lvalue. llvm-svn: 86307
* When looking for a copy-assignment operator to determine the cv-qualifiers ↵Douglas Gregor2009-10-301-1/+4
| | | | | | on its argument type, ignore assignment operator templates llvm-svn: 85629
* Audit the code for places where it is assumed that every base specifier ↵Sebastian Redl2009-10-251-16/+18
| | | | | | refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector. llvm-svn: 85055
* Member function templates (and instantiations/specializations thereof)Douglas Gregor2009-10-131-2/+10
| | | | | | are never copy constructors or copy assignment operators. llvm-svn: 84057
* Diagnose the declaration of explicit specializations after an implicitDouglas Gregor2009-10-121-6/+7
| | | | | | | instantiation has already been required. To do so, keep track of the point of instantiation for anything that can be instantiated. llvm-svn: 83890
* Use CanQualType (instead of QualType) to store collection of visibleFariborz Jahanian2009-10-121-7/+9
| | | | | | canonical conversion types. llvm-svn: 83869
* Refactoring to further simplify collection of visible conversionFariborz Jahanian2009-10-081-22/+16
| | | | | | functions. llvm-svn: 83552
* Improve checking for specializations of member classes of classDouglas Gregor2009-10-081-0/+47
| | | | | | | | | | | templates, and keep track of how those member classes were instantiated or specialized. Make sure that we don't try to instantiate an explicitly-specialized member class of a class template, when that explicit specialization was a declaration rather than a definition. llvm-svn: 83547
* Fixes problem in finding visible convertion functions of a classFariborz Jahanian2009-10-071-29/+63
| | | | | | | | where matching conversion types in base classes were still visible. Plus refactoring and cleanup. Added a test case. llvm-svn: 83485
* Handle C++ delete expressions when the overloaded delete operator is aDouglas Gregor2009-09-291-0/+34
| | | | | | | | | | | "usual deallocation function" with two arguments. CodeGen will have to handle this case specifically, since the value for the second argument (the size of the allocated object) may have to be computed at run time. Fixes the Sema part of PR4782. llvm-svn: 83080
* Refactor the representation of qualifiers to bring ExtQualType out of theJohn McCall2009-09-241-4/+7
| | | | | | | | Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our use of qualifiers and fix a few places that weren't dealing with qualifiers quite right; many more remain. llvm-svn: 82705
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-3/+3
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* In building list of visible conversion functions, useFariborz Jahanian2009-09-151-2/+2
| | | | | | result type of template convesion functions. llvm-svn: 81943
* 1) don't do overload resolution in selecting conversionFariborz Jahanian2009-09-151-2/+3
| | | | | | | | to pointer function for delete expression. 2) Treat type conversion function and its 'const' version as identical in building the visible conversion list. llvm-svn: 81930
* Make sure we're comparing the canonical types when we determineDouglas Gregor2009-09-151-2/+3
| | | | | | | | | whether a constructor is a copy constructor. Sadly, I wasn't able to get down to a test case smaller than libstdc++'s <string>. llvm-svn: 81913
* More improvement in building list of visible conversionFariborz Jahanian2009-09-121-34/+36
| | | | | | functions for a class when needed. llvm-svn: 81624
* Removed Context argument from couple of methods which don'tFariborz Jahanian2009-09-121-4/+2
| | | | | | need them. llvm-svn: 81621
* More work toward having an access method for visibleFariborz Jahanian2009-09-121-35/+52
| | | | | | conversion functions. llvm-svn: 81618
* No need to build the visible conversionfunction list for root class.Fariborz Jahanian2009-09-111-5/+10
| | | | llvm-svn: 81583
* Patch to build visible conversion function list lazily and make its Fariborz Jahanian2009-09-111-0/+84
| | | | | | first use in calling the conversion function on delete statements. llvm-svn: 81576
* Tweak the semantics of FunctionDecl::isOutOfLine to consider anDouglas Gregor2009-09-111-1/+0
| | | | | | | | | | instantiation of a member function template or member function of a class template to be out-of-line if the definition of that function template or member function was defined out-of-line. This ensures that we get the correct linkage for explicit instantiations of out-of-line definitions. llvm-svn: 81562
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-59/+59
| | | | llvm-svn: 81346
* When searching for a default constructor or copy constructor, skip ↵Douglas Gregor2009-09-041-0/+9
| | | | | | constructor templates llvm-svn: 81002
* Patch to instantiate destructors used to destructFariborz Jahanian2009-09-031-61/+0
| | | | | | base and data members when they are needed. llvm-svn: 80967
* Issue diagnostics in variety of situations involvingFariborz Jahanian2009-09-031-153/+0
| | | | | | | | reference/const data members when user has declared the constructor. This necessitated some non-minor refactoring. llvm-svn: 80934
* After a conversation with Doug. I added a fix me toFariborz Jahanian2009-09-011-0/+13
| | | | | | where we build the constructor's initializer list. llvm-svn: 80735
* In CXXBaseOrMemberInitializer, don't confuse CtorTocall withDouglas Gregor2009-09-011-4/+4
| | | | | | AnonUnionMember. Fixes PR4826. llvm-svn: 80721
* Fix a crasher involving template instantiation of non-dependentDouglas Gregor2009-09-011-2/+4
| | | | | | | expressions making use of an overloaded operator. Thanks for the test case, Anders! llvm-svn: 80679
* Fix a -Asserts warning.Daniel Dunbar2009-08-311-0/+2
| | | | llvm-svn: 80606
* Make instantiating initializers for classes with a dependent base type Eli Friedman2009-08-291-49/+64
| | | | | | | | | work correctly. The change in lib/AST/DeclCXX.cpp is mostly a large reindentation; I couldn't figure out a good way to avoid it. llvm-svn: 80446
* Store the SourceLocation of right parentheses in member initializers. Patch ↵Anders Carlsson2009-08-291-4/+7
| | | | | | by Anders Johnsen! llvm-svn: 80416
* Fix this for real.Anders Carlsson2009-08-281-2/+2
| | | | llvm-svn: 80377
* Omnibus friend decl refactoring. Instead of cloning AST classes for friendJohn McCall2009-08-281-13/+13
| | | | | | | | | | | | | | declarations of same, introduce a single AST class and add appropriate bits (encoded in the namespace) for whether a decl is "real" or not. Much hackery about previously-declared / not-previously-declared, but it's essentially mandated by the standard that friends alter lookup, and this is at least fairly non-intrusive. Refactor the Sema methods specific to friends for cleaner flow and less nesting. Incidentally solve a few bugs, but I remain confident that we can put them back. llvm-svn: 80353
* Check in UnresolvedUsingDecl.Anders Carlsson2009-08-281-0/+11
| | | | llvm-svn: 80336
* Skip over bases/fields with dependent types.Fariborz Jahanian2009-08-251-0/+4
| | | | | | Fixes pr4771. llvm-svn: 79999
* BuildCXXConstructExpr now returns an OwningExprResult.Anders Carlsson2009-08-251-1/+1
| | | | llvm-svn: 79975
* Fixes pr4763. Fariborz Jahanian2009-08-241-4/+7
| | | | llvm-svn: 79923
* Implement conversion function templates, along with the ability to useDouglas Gregor2009-08-211-0/+8
| | | | | | | template argument deduction from a conversion function (C++ [temp.deduct.conv]) with implicit conversions. llvm-svn: 79693
* Introduce support for constructor templates, which can now be declaredDouglas Gregor2009-08-211-0/+12
| | | | | | | | and will participate in overload resolution. Unify the instantiation of CXXMethodDecls and CXXConstructorDecls, which had already gotten out-of-sync. llvm-svn: 79658
* We now support overriding base functions in vtables. WIP.Mike Stump2009-08-211-0/+2
| | | | llvm-svn: 79587
* Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema ↵Argyrios Kyrtzidis2009-08-191-7/+12
| | | | | | | | | | | | interfaces. DeclaratorDecl contains a DeclaratorInfo* to keep type source info. Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl. EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo. Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet. llvm-svn: 79392
OpenPOWER on IntegriCloud