summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor instantiation of destructors to use the common CXXMethodDeclDouglas Gregor2009-08-211-0/+11
| | | | | | | | | | | code, fixing a problem where instantiations of out-of-line destructor definitions would had the wrong lexical context. Introduce tests for out-of-line definitions of the constructors, destructors, and conversion functions of a class template partial specialization. llvm-svn: 79682
* Add test for out-of-line definition of a conversion functionDouglas Gregor2009-08-211-0/+7
| | | | llvm-svn: 79679
* Fix parsing for out-of-line definitions of constructors andDouglas Gregor2009-08-211-1/+10
| | | | | | destructors of class templates. llvm-svn: 79678
* Basic nested-template implementation.John McCall2009-08-201-0/+16
| | | | llvm-svn: 79504
* Support friend declarations in templates and test that argdep lookupJohn McCall2009-08-141-0/+20
| | | | | | still works. llvm-svn: 78979
* When we encounter a dependent type that was parsed before we know thatDouglas Gregor2009-08-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | we were going to enter into the scope of a class template or class template partial specialization, rebuild that type so that it can refer to members of the current instantiation, as in code like template<typename T> struct X { typedef T* pointer; pointer data(); }; template<typename T> typename X<T>::pointer X<T>::data() { ... } Without rebuilding the return type of this out-of-line definition, the canonical return type of the out-of-line definition (a TypenameType) will not match the canonical return type of the declaration (the canonical type of T*). llvm-svn: 78316
* Make the recanonicalization-for-an-out-of-line-definition test case a bit ↵Douglas Gregor2009-07-311-1/+18
| | | | | | trickier llvm-svn: 77707
* Support out-of-line definitions of the members of class templateDouglas Gregor2009-07-302-0/+40
| | | | | | partial specializations. llvm-svn: 77606
* Use the new statement/expression profiling code to unique dependentDouglas Gregor2009-07-291-1/+0
| | | | | | | | template arguments, as in template specialization types. This permits matching out-of-line definitions of members for class templates that involve non-type template parameters. llvm-svn: 77462
* Add a template test that requires canonical expression comparisonDouglas Gregor2009-07-281-0/+17
| | | | llvm-svn: 77325
* Update for LLVM API change.Owen Anderson2009-07-277-7/+7
| | | | llvm-svn: 77249
* Make having no RUN line a failure.Daniel Dunbar2009-07-251-0/+3
| | | | | | | Doug, please look at decltype-crash and instantiate-function-1.mm, I'm not sure if they are actually testing the right thing / anything. llvm-svn: 77070
* Template instantiation for static data members that are defined out-of-line.Douglas Gregor2009-07-242-2/+30
| | | | | | | | 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
* Implement support for out-of-line definitions of the class members of classDouglas Gregor2009-07-221-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | templates, e.g., template<typename T> struct Outer { struct Inner; }; template<typename T> struct Outer<T>::Inner { // ... }; Implementing this feature required some extensions to ActOnTag, which now takes a set of template parameter lists, and is the precursor to removing the ActOnClassTemplate function from the parser Action interface. The reason for this approach is simple: the parser cannot tell the difference between a class template definition and the definition of a member of a class template; both have template parameter lists, and semantic analysis determines what that template parameter list means. There is still some cleanup to do with ActOnTag and ActOnClassTemplate. This commit provides the basic functionality we need, however. llvm-svn: 76820
* Implement parsing and semantic analysis for out-of-line definitions of staticDouglas Gregor2009-07-221-0/+26
| | | | | | | data members of class templates. We don't instantiate the definitions yet, however. llvm-svn: 76756
* Test template instantiation for member functions of class templates definedDouglas Gregor2009-07-221-0/+17
| | | | | | out of line. llvm-svn: 76740
* Complain if we're entering the context of a dependent nested-name-specifier butDouglas Gregor2009-07-221-0/+4
| | | | | | | cannot match that nested-name-specifier to a class template or class template partial specialization. llvm-svn: 76704
* Basic parsing and semantic analysis for out-of-line definitions of theDouglas Gregor2009-07-212-0/+57
| | | | | | | | | | | | | member functions of class templates, e.g., template<typename T> struct X { void f(T); }; template<typename T> X<T>::f(T) { /* ... */ } llvm-svn: 76692
* Prep for new warning.Mike Stump2009-07-211-3/+3
| | | | llvm-svn: 76640
* Implement template argument deduction when taking the address of aDouglas Gregor2009-07-081-0/+22
| | | | | | | | function template. Most of the change here is in factoring out the common bits used for template argument deduction from a function call and when taking the address of a function template. llvm-svn: 75044
* Improve template argument deduction from a call. In particular,Douglas Gregor2009-07-071-2/+28
| | | | | | | | implement C++ [temp.deduct.call]p3b3, which allows a template-id parameter to match a derived class of the argument, while deducing template arguments. llvm-svn: 74965
* Fix RUN line so this test doesn't hang.Ted Kremenek2009-07-021-1/+1
| | | | llvm-svn: 74719
* Keep track of more information within the template instantiation stack, e.g.,Douglas Gregor2009-07-011-0/+17
| | | | | | | | | | | | | | 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/+11
| | | | | | | are fewer template arguments than there are template parameters for that function. llvm-svn: 74578
* When explicit template arguments are provided for a function call,Douglas Gregor2009-06-301-4/+5
| | | | | | | | | substitute those template arguments into the function parameter types prior to template argument deduction. There's still a bit of work to do to make this work properly when only some of the template arguments are specified. llvm-svn: 74576
* Preliminary parsing and ASTs for template-ids that refer to functionDouglas Gregor2009-06-301-0/+11
| | | | | | | templates, such as make<int&>. These template-ids are only barely functional for function calls; much more to come. llvm-svn: 74563
* During template argument deduction from a function call, allowDouglas Gregor2009-06-261-1/+10
| | | | | | | | deduction from pointer and pointer-to-member types to work even in the presence of a qualification conversion (C++ [temp.deduct.type]p3 bullet 2). llvm-svn: 74354
* A little template argument deduction test uncovered an "oops". As partDouglas Gregor2009-06-261-0/+7
| | | | | | | | | | 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
* Template argument deduction is no longer responsible for checkingDouglas Gregor2009-06-261-1/+18
| | | | | | | | | | | | | non-dependent parameter types. Instead, class template partial specializations perform a final check of all of the instantiated arguments. This model is cleaner, and works better for function templates where the "final check" occurs during overload resolution. Also, cope with cv-qualifiers when the parameter type was originally a reference type, so that the deduced argument can be more qualified than the transformed argument. llvm-svn: 74323
* Improve template argument deduction for reference parameters whenDouglas Gregor2009-06-262-0/+75
| | | | | | | deducing template arguments from a function call. Plus, add a bunch of tests. llvm-svn: 74301
* Improved semantic analysis and AST respresentation for functionDouglas Gregor2009-06-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | templates. For example, this now type-checks (but does not instantiate the body of deref<int>): template<typename T> T& deref(T* t) { return *t; } void test(int *ip) { int &ir = deref(ip); } Specific changes/additions: * Template argument deduction from a call to a function template. * Instantiation of a function template specializations (just the declarations) from the template arguments deduced from a call. * FunctionTemplateDecls are stored directly in declaration contexts and found via name lookup (all forms), rather than finding the FunctionDecl and then realizing it is a template. This is responsible for most of the churn, since some of the core declaration matching and lookup code assumes that all functions are FunctionDecls. llvm-svn: 74213
* Implement matching of function templates, so that one can declare overloaded ↵Douglas Gregor2009-06-242-0/+40
| | | | | | function templates. C++ [temp.over.link] paragraphs 4-8. llvm-svn: 74079
* Add a test illustrating our current inability to properly cope with the ↵Douglas Gregor2009-06-231-0/+32
| | | | | | point of instantation of a member function of a class template specialization llvm-svn: 73956
* Move a bunch of tests into temp.param, and write a few tests for paragraphs ↵Douglas Gregor2009-06-1313-0/+203
that hadn't been touched before llvm-svn: 73288
OpenPOWER on IntegriCloud