summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* An explicit instantiation definition only instantiations those classDouglas Gregor2009-10-271-11/+4
| | | | | | | | | members that have a definition. Also, use CheckSpecializationInstantiationRedecl as part of this instantiation to make sure that we diagnose the various kinds of problems that can occur with explicit instantiations. llvm-svn: 85270
* Preserve type source information in TypedefDecls. Preserve it acrossJohn McCall2009-10-241-7/+7
| | | | | | | | | template instantiation. Preserve it through PCH. Show it off to the indexer. I'm healthily ignoring the vector type cases because we don't have a sensible TypeLoc implementation for them anyway. llvm-svn: 84994
* Implement template instantiation for non-type templateDouglas Gregor2009-10-231-0/+39
| | | | | | parameters. Fixes PR5103. llvm-svn: 84979
* Remove OriginalTypeParmDecl; the original type is the one specifiedJohn McCall2009-10-231-24/+17
| | | | | | | | | | | | | in the DeclaratorInfo, if one is present. Preserve source information through template instantiation. This is made more complicated by the possibility that ParmVarDecls don't have DIs, which is possibly worth fixing in the future. Also preserve source information for function parameters in ObjC method declarations. llvm-svn: 84971
* Preserve type source information when substituting into FieldDecls.John McCall2009-10-221-9/+11
| | | | | | Just r84734 now that some fundamental work has been completed. llvm-svn: 84914
* Revert those last two commits. Beware the treacherous semicolon.John McCall2009-10-211-14/+14
| | | | llvm-svn: 84736
* Preserve type source information when substituting into ParmVarDecls.John McCall2009-10-211-7/+7
| | | | | | Apparently I'm grinding my commit count. llvm-svn: 84735
* Preserve type source information when substituting into FieldDecls.John McCall2009-10-211-7/+7
| | | | llvm-svn: 84734
* Preserve source information when substituting into VarDecls.John McCall2009-10-211-5/+6
| | | | llvm-svn: 84733
* Make sure that we're diagnosing duplicate explicit instantiation definitions.Douglas Gregor2009-10-151-1/+4
| | | | llvm-svn: 84189
* Diagnose explicit instantiations of function templates and memberDouglas Gregor2009-10-151-3/+36
| | | | | | | | functions/static data members of class template specializations that do not have definitions. This is the latter part of [temp.explicit]p4; the former part still needs more testing. llvm-svn: 84182
* Give explicit and implicit instantiations of static data members ofDouglas Gregor2009-10-141-3/+5
| | | | | | | | class templates the proper linkage. Daniel, please look over the CodeGenModule bits. llvm-svn: 84140
* Testing and some minor fixes for explicit template instantiation.Douglas Gregor2009-10-141-1/+3
| | | | llvm-svn: 84129
* When explicitly specializing a member that is a template, mark theDouglas Gregor2009-10-131-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | template as a specialization. For example, this occurs with: template<typename T> struct X { template<typename U> struct Inner { /* ... */ }; }; template<> template<typename T> struct X<int>::Inner { T member; }; We need to treat templates that are member specializations as special in two contexts: - When looking for a definition of a member template, we look through the instantiation chain until we hit the primary template *or a member specialization*. This allows us to distinguish between the primary "Inner" definition and the X<int>::Inner definition, above. - When computing all of the levels of template arguments needed to instantiate a member template, don't add template arguments from contexts outside of the instantiation of a member specialization, since the user has already manually substituted those arguments. Fix up the existing test for p18, which was actually wrong (but we didn't diagnose it because of our poor handling of member specializations of templates), and add a new test for member specializations of templates. llvm-svn: 83974
* Improve the internal representation and semantic analysis of friendDouglas Gregor2009-10-131-27/+92
| | | | | | | | | | | | | | | function templates. This commit ensures that friend function templates are constructed as FunctionTemplateDecls rather than partial FunctionDecls (as they previously were). It then implements template instantiation for friend function templates, injecting the friend function template only when no previous declaration exists at the time of instantiation. Oh, and make sure that explicit specialization declarations are not friends. llvm-svn: 83970
* When declaring a class template whose name is qualified, make sureDouglas Gregor2009-10-121-2/+6
| | | | | | | | that the scope in which it is being declared is complete. Also, when instantiating a member class template's ClassTemplateDecl, be sure to delay type creation so that the resulting type is dependent. Ick. llvm-svn: 83923
* Permit explicit specialization of member functions of class templatesDouglas Gregor2009-10-121-1/+3
| | | | | | | | that are declarations (rather than definitions). Also, be sure to set the access specifiers properly when instantiating the declarations of member function templates. llvm-svn: 83911
* Refactor the LookupResult API to simplify most common operations. Require ↵John McCall2009-10-091-2/+3
| | | | | | | | | users to pass a LookupResult reference to lookup routines. Call out uses which assume a single result. llvm-svn: 83674
* Improve checking for specializations of member classes of classDouglas Gregor2009-10-081-1/+1
| | | | | | | | | | | 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
* For instantiations of static data members of class templates, keepDouglas Gregor2009-10-081-7/+21
| | | | | | | | track of the kind of specialization or instantiation. Also, check the scope of the specialization and ensure that a specialization declaration without an initializer is not a definition. llvm-svn: 83533
* Keep track of whether a member function instantiated from a memberDouglas Gregor2009-10-071-2/+2
| | | | | | | | | function of a class template was implicitly instantiated, explicitly instantiated (declaration or definition), or explicitly specialized. The same MemberSpecializationInfo structure will be used for static data members and member classes as well. llvm-svn: 83509
* Class template partial specializations can be declared anywhere thatDouglas Gregor2009-10-071-0/+9
| | | | | | | | | | its definition may be defined, including in a class. Also, put in an assertion when trying to instantiate a class template partial specialization of a member template, which is not yet implemented. llvm-svn: 83469
* Properly match instantiations of member function templates to the function ↵Douglas Gregor2009-09-281-0/+16
| | | | | | templates from which they were instantiated llvm-svn: 82969
* Sigh. Be *really* careful when copying a default function argument during ↵Douglas Gregor2009-09-251-1/+3
| | | | | | template instantiation llvm-svn: 82761
* Be careful about copying uninstantiated default arguments during template ↵Douglas Gregor2009-09-251-2/+2
| | | | | | instantiation llvm-svn: 82760
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-2/+2
| | | | | | | | | | | 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
* Teach Sema::FindInstantiatedDecl to find instantiated RecordDecls evenDouglas Gregor2009-09-161-19/+63
| | | | | | | | | | when we are not instantiating the corresponding "current instantiation." This happens, e.g., when we are instantiating a declaration reference that refers into the "current instantiation" but occurs in a default function argument. The libstdc++ vector default constructor now instantiates properly. llvm-svn: 82069
* Implement partial ordering of class template partial specializations Douglas Gregor2009-09-151-2/+2
| | | | | | (C++ [temp.class.order]). llvm-svn: 81866
* Slight improvement for extern templates, so that an explicitDouglas Gregor2009-09-111-0/+3
| | | | | | | | | instantiation definition can follow an explicit instantiation declaration. This is as far as I want to go with extern templates now, but they will still need quite a bit more work to get all of the C++0x semantics right. llvm-svn: 81573
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-176/+176
| | | | llvm-svn: 81346
* Improve the AST representation and semantic analysis for externDouglas Gregor2009-09-041-2/+15
| | | | | | | | | | | templates. We now distinguish between an explicit instantiation declaration and an explicit instantiation definition, and know not to instantiate explicit instantiation declarations. Unfortunately, there is some remaining confusion w.r.t. instantiation of out-of-line member function definitions that causes trouble here. llvm-svn: 81053
* Fix a codegen crash when a class template has a constructor that does member ↵Anders Carlsson2009-09-021-9/+11
| | | | | | initialization of an anonymous union. llvm-svn: 80826
* In CXXBaseOrMemberInitializer, don't confuse CtorTocall withDouglas Gregor2009-09-011-1/+2
| | | | | | AnonUnionMember. Fixes PR4826. llvm-svn: 80721
* Implement proper substitution for OverloadedFunctionDecls, but substituting ↵Douglas Gregor2009-09-011-3/+19
| | | | | | each of the functions in the overload set llvm-svn: 80692
* Don't assume that a base is always a RecordType, it can also be a ↵Anders Carlsson2009-09-011-2/+1
| | | | | | TemplateSpecializationType. Also, make sure to get the instantiated union member. llvm-svn: 80662
* Add pretty stack traces when instantiating functions and static data members.Anders Carlsson2009-09-011-0/+13
| | | | llvm-svn: 80661
* Handle member initializers that point to fields in anonymous structs.Anders Carlsson2009-09-011-2/+7
| | | | llvm-svn: 80659
* Don't assert when instantiating member references to fields in anonymous ↵Anders Carlsson2009-09-011-2/+15
| | | | | | structs. llvm-svn: 80657
* Fix bug 4784 and allow friend declarations to properly extendJohn McCall2009-08-311-1/+1
| | | | | | existing declaration chains. llvm-svn: 80636
* Unbreak tests. I'll look into why this is necessary later.Eli Friedman2009-08-301-0/+1
| | | | llvm-svn: 80468
* Make instantiating initializers for classes with a dependent base type Eli Friedman2009-08-291-3/+3
| | | | | | | | | 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
* Improve instantiation of UnresolvedUsingDecls.Anders Carlsson2009-08-291-5/+23
| | | | llvm-svn: 80434
* Fix the breakage by handling indirect instantiations. This would be muchJohn McCall2009-08-291-47/+103
| | | | | | | | improved if there were a consistent name for getInstantiatedFromMemberX() across all classes. Cheap refactor if someone wants to do it, but let's get the buildbots happy first. llvm-svn: 80425
* Instantiate member and base initializers. Patch by Anders Johnsen! (tweaked ↵Anders Carlsson2009-08-291-2/+76
| | | | | | slightly by me) llvm-svn: 80422
* For consistency, just make friend declarations AS_public.John McCall2009-08-291-0/+1
| | | | llvm-svn: 80420
* Ensure code generation for friend declarations in class templates.John McCall2009-08-291-0/+2
| | | | llvm-svn: 80418
* Remove #if 0'd code that is clearly not neededDouglas Gregor2009-08-281-24/+0
| | | | llvm-svn: 80399
* Don't crash when instantiating templates containing anonymous structs/unionsDouglas Gregor2009-08-281-14/+26
| | | | llvm-svn: 80397
* Fix and test template instantiation for nested member templates.Douglas Gregor2009-08-281-2/+5
| | | | llvm-svn: 80394
* Implement template instantiation for member class templates.Douglas Gregor2009-08-281-9/+9
| | | | | | | | | | When performing template instantiation of the definitions of member templates (or members thereof), we build a data structure containing the template arguments from each "level" of template instantiation. During template instantiation, we substitute all levels of template arguments simultaneously. llvm-svn: 80389
OpenPOWER on IntegriCloud