summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiate.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve checking for specializations of member classes of classDouglas Gregor2009-10-081-4/+19
| | | | | | | | | | | 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-3/+6
| | | | | | | | 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
* Make sure to set the template specialization kind of an explicitDouglas Gregor2009-10-081-3/+3
| | | | | | | template instantiation of a member function of a class template. FIXME -= 2; llvm-svn: 83520
* Keep track of whether a member function instantiated from a memberDouglas Gregor2009-10-071-4/+11
| | | | | | | | | 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
* Slightly improve the semantics of extern templates for member functions of ↵Douglas Gregor2009-09-291-2/+3
| | | | | | class templates llvm-svn: 83063
* Refactor the representation of qualifiers to bring ExtQualType out of theJohn McCall2009-09-241-1/+1
| | | | | | | | 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
* Teach Sema::FindInstantiatedDecl to find instantiated RecordDecls evenDouglas Gregor2009-09-161-3/+4
| | | | | | | | | | 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
* Slightly improved template argument deduction for use in partialDouglas Gregor2009-09-151-0/+3
| | | | | | | ordering, along with another test case for partial ordering of partial specializations. llvm-svn: 81869
* Implement partial ordering of class template partial specializations Douglas Gregor2009-09-151-10/+43
| | | | | | (C++ [temp.class.order]). llvm-svn: 81866
* Slight improvement for extern templates, so that an explicitDouglas Gregor2009-09-111-4/+21
| | | | | | | | | 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
* Track a class template specialization's point of instantiation separatelyJohn McCall2009-09-111-1/+1
| | | | | | | | | | from its location. Initialize appropriately. When implicitly creating a declaration of a class template specialization after encountering the first reference to it, use the pattern class's location instead of the location of the first reference. llvm-svn: 81515
* Support elaborated dependent types and diagnose tag mismatches.John McCall2009-09-111-1/+31
| | | | llvm-svn: 81504
* Instantiate PredefinedExprs correctly. Patch by Sam Weinig!Anders Carlsson2009-09-111-0/+24
| | | | llvm-svn: 81498
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-110/+109
| | | | llvm-svn: 81346
* Report errors for member functions correctly.Anders Carlsson2009-09-051-2/+1
| | | | llvm-svn: 81063
* Use a separate diagnostic for default function argument expressions.Anders Carlsson2009-09-051-0/+43
| | | | llvm-svn: 81062
* Improve the AST representation and semantic analysis for externDouglas Gregor2009-09-041-17/+21
| | | | | | | | | | | 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
* Improve template instantiation for member access expressions thatDouglas Gregor2009-09-031-3/+5
| | | | | | | | | involve qualified names, e.g., x->Base::f. We now maintain enough information in the AST to compare the results of the name lookup of "Base" in the scope of the postfix-expression (determined at template definition time) and in the type of the object expression. llvm-svn: 80953
* Implement proper substitution for OverloadedFunctionDecls, but substituting ↵Douglas Gregor2009-09-011-8/+0
| | | | | | each of the functions in the overload set llvm-svn: 80692
* Improve instantiation of UnresolvedUsingDecls.Anders Carlsson2009-08-291-0/+7
| | | | llvm-svn: 80434
* Ensure code generation for friend declarations in class templates.John McCall2009-08-291-5/+13
| | | | llvm-svn: 80418
* Implement template instantiation for member class templates.Douglas Gregor2009-08-281-102/+87
| | | | | | | | | | 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
* Collect multiple levels of template arguments into a new type,Douglas Gregor2009-08-281-21/+30
| | | | | | | MultiLevelTemplateArgumentList. This is a baby step toward instantiating member templates; no intended functionality change yet. llvm-svn: 80380
* Clarify the difference between substitution and instantiation by renamingJohn McCall2009-08-251-32/+33
| | | | | | functions that don't instantiate definitions. llvm-svn: 80037
* Try to complete a type before looking for conversion functions withinDouglas Gregor2009-08-241-4/+15
| | | | | | | that type. Note that we do not produce a diagnostic if the type is incomplete; rather, we just don't look for conversion functions. Fixes PR4660. llvm-svn: 79919
* Refactor the instantiation of statements into a generic treeDouglas Gregor2009-08-201-29/+48
| | | | | | transformation. llvm-svn: 79519
* Basic nested-template implementation.John McCall2009-08-201-0/+36
| | | | llvm-svn: 79504
* Refactor the template-instantiation logic for expressions into aDouglas Gregor2009-08-111-8/+112
| | | | | | | generic tree transformation (also used for recanonicalization) and a small amount of template-instantiation-specific logic. llvm-svn: 78645
* Implement transformation of template names within the generic treeDouglas Gregor2009-08-061-69/+16
| | | | | | | | | | | | | | | transform, then use the result for template instantiation. The generic transformation fixes a few issues: - It copes better with template template parameters and member templates (when they're implemented). - The logic used to replace template template parameters with their arguments is now centralized in TransformDecl, so that it will apply for other declaration-instantiation steps. - The error-recovery strategy is normalized now, so that any error results in a NULL TemplateName. llvm-svn: 78292
* Implement transformation of nested-name-specifiers within the generalDouglas Gregor2009-08-061-63/+3
| | | | | | | tree transformation. Template instantiation uses this general transformation rather than implementing its own transformation. llvm-svn: 78286
* Move the template instantiation logic for template arguments into theDouglas Gregor2009-08-041-46/+3
| | | | | | | | | | general tree transformation. Also, implement template instantiation for parameter packs. In addition, introduce logic to enter the appropriate context for subexpressions that are not potentially evaluated. llvm-svn: 78114
* Refactor template instantiation for types into a generic treeDouglas Gregor2009-08-041-442/+71
| | | | | | | | | transformation template (TreeTransform) that handles the transformation and reconstruction of AST nodes. Template instantiation for types is a (relatively small) customization of the generic tree transformation. llvm-svn: 78071
* Keep track of the template arguments deduced when matching a classDouglas Gregor2009-08-021-2/+3
| | | | | | | | template partial specialization. Then, use those template arguments when instantiating members of that class template partial specialization. Fixes PR4607. llvm-svn: 77925
* Template instantiation for static data members that are defined out-of-line.Douglas Gregor2009-07-241-5/+8
| | | | | | | | Note that this also fixes a bug that affects non-template code, where we were not treating out-of-line static data members are "file-scope" variables, and therefore not checking their initializers. llvm-svn: 77002
* Improve template argument deduction for array types, so that a parameterDouglas Gregor2009-07-221-0/+1
| | | | | | | | | | const T can be matched with, e.g., volatile int [5] llvm-svn: 76773
* Allocate BaseOrMemberInitializers and CXXBaseSpecifier nodesFariborz Jahanian2009-07-221-2/+1
| | | | | | via ASTContext. llvm-svn: 76758
* Remove ObjCQualifiedInterfaceType:-)Steve Naroff2009-07-181-8/+0
| | | | llvm-svn: 76321
* Remove ASTContext::getCanonicalDecl() and use Decl::getCanonicalDecl in its ↵Argyrios Kyrtzidis2009-07-181-1/+1
| | | | | | place. llvm-svn: 76274
* Keep track of the Expr used to describe the size of an array type,Douglas Gregor2009-07-061-4/+20
| | | | | | from Enea Zaffanella! llvm-svn: 74831
* Keep track of more information within the template instantiation stack, e.g.,Douglas Gregor2009-07-011-20/+59
| | | | | | | | | | | | | | by distinguishing between substitution that occurs for template argument deduction vs. explicitly-specifiad template arguments. This is used both to improve diagnostics and to make sure we only provide SFINAE in those cases where SFINAE should apply. In addition, deal with the sticky issue where SFINAE only considers substitution of template arguments into the *type* of a function template; we need to issue hard errors beyond this point, as test/SemaTemplate/operator-template.cpp illustrates. llvm-svn: 74651
* Cope with explicitly-specified function template arguments when thereDouglas Gregor2009-07-011-0/+9
| | | | | | | are fewer template arguments than there are template parameters for that function. llvm-svn: 74578
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-301-4/+4
| | | | | | | Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
* Remove the ASTContext parameter from the getBody() methods of Decl and ↵Argyrios Kyrtzidis2009-06-301-1/+1
| | | | | | | | subclasses. Timings showed no significant difference before and after the commit. llvm-svn: 74504
* Improvements to decltype. We now don't crash anymore when the expr is an ↵Anders Carlsson2009-06-291-2/+2
| | | | | | overloaded function decl. llvm-svn: 74472
* A little template argument deduction test uncovered an "oops". As partDouglas Gregor2009-06-261-87/+61
| | | | | | | | | | of template instantiation, we were dropping cv-qualifiers on the instantiated type in a few places. This change reshuffles the type-instantiation code a little bit so that there's a single place where we add qualifiers to the instantiated type, so that we won't end up with this same bug in the future. llvm-svn: 74331
* Fix PR4448.Anders Carlsson2009-06-261-0/+5
| | | | llvm-svn: 74257
* Implicit instantiation for function template specializations.Douglas Gregor2009-06-261-2/+13
| | | | | | | | | For a FunctionDecl that has been instantiated due to template argument deduction, we now store the primary template from which it was instantiated and the deduced template arguments. From this information, we can instantiate the body of the function template. llvm-svn: 74232
* Add a DecltypeType type.Anders Carlsson2009-06-241-0/+12
| | | | llvm-svn: 74099
* Rework the way we track which declarations are "used" duringDouglas Gregor2009-06-221-0/+11
| | | | | | | | | | | | | | | | | | | | | compilation, and (hopefully) introduce RAII objects for changing the "potentially evaluated" state at all of the necessary places within Sema and Parser. Other changes: - Set the unevaluated/potentially-evaluated context appropriately during template instantiation. - We now recognize three different states while parsing or instantiating expressions: unevaluated, potentially evaluated, and potentially potentially evaluated (for C++'s typeid). - When we're in a potentially potentially-evaluated context, queue up MarkDeclarationReferenced calls in a stack. For C++ typeid expressions that are potentially evaluated, we will play back these MarkDeclarationReferenced calls when we exit the corresponding potentially potentially-evaluated context. - Non-type template arguments are now parsed as constant expressions, so they are not potentially-evaluated. llvm-svn: 73899
* Some cleanups suggested by ChrisDouglas Gregor2009-06-181-4/+4
| | | | llvm-svn: 73713
OpenPOWER on IntegriCloud