summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp
Commit message (Collapse)AuthorAgeFilesLines
...
* More explicit template instantiation. Now we're checking for moreDouglas Gregor2009-10-151-0/+55
| | | | | | | | cases where an explicit instantiation requires a definition; the remainder of these checks will come with the implementation of paragraph 4 of [temp.explicit]. llvm-svn: 84181
* Additional semantic checking for explicit template instantiations,Douglas Gregor2009-10-141-0/+43
| | | | | | | focusing on the scope- and qualifier-related semantic requirements in C++ [temp.explicit]p2. llvm-svn: 84154
* Check the implicit instantiation of a static data member of a classDouglas Gregor2009-10-141-3/+6
| | | | | | template that has no out-of-line definition. llvm-svn: 84141
* Give explicit and implicit instantiations of static data members ofDouglas Gregor2009-10-141-0/+26
| | | | | | | | 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-142-0/+99
| | | | llvm-svn: 84129
* Unify our diagnostic printing for errors of the form, "we didn't likeDouglas Gregor2009-10-131-3/+3
| | | | | | | | | | what we found when we looked into <blah>", where <blah> is a DeclContext*. We can now format DeclContext*'s in nice ways, e.g., "namespace N", "the global namespace", "'class Foo'". This is part of PR3990, but we're not quite there yet. llvm-svn: 84028
* Diagnose attempts to add default function arguments to aDouglas Gregor2009-10-131-0/+30
| | | | | | specialization. This completes C++ [temp.expl.spec]! llvm-svn: 83980
* When explicitly specializing a member that is a template, mark theDouglas Gregor2009-10-132-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+14
| | | | | | | | | | | | | | | 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-0/+16
| | | | | | | | 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
* Test explicit specialization involving multiple template<> headersDouglas Gregor2009-10-121-0/+12
| | | | llvm-svn: 83914
* Permit explicit specialization of member functions of class templatesDouglas Gregor2009-10-121-0/+26
| | | | | | | | 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
* Test explicit specializations of static data members that are declarations, ↵Douglas Gregor2009-10-121-0/+22
| | | | | | not definitions llvm-svn: 83904
* Yet another test for explicit specialization, this one involving linkageDouglas Gregor2009-10-121-0/+42
| | | | llvm-svn: 83901
* More tests for explicit template specializationDouglas Gregor2009-10-124-0/+35
| | | | llvm-svn: 83896
* Add test for last commitDouglas Gregor2009-10-121-0/+56
| | | | llvm-svn: 83893
* Fix up error reporting when object cannot be constructed Fariborz Jahanian2009-10-081-1/+1
| | | | | | | because of missing default constructor of a member. Fixes pr5154. llvm-svn: 83583
* Add more testing for the properties of explicit specialization. Douglas Gregor2009-10-083-0/+134
| | | | | | | Also, eliminate a redundant diagnostic by marking a variable declared with incomplete type as an invalid declaration. llvm-svn: 83553
* Don't complain about out-of-line explicit specializations of memberDouglas Gregor2009-10-081-8/+31
| | | | | | | | function and member function templates that are not definitions. Add more tests to ensure that explicit specializations of member function templates prevent instantiation. llvm-svn: 83550
* More testing for explicit specializations of member class templatesDouglas Gregor2009-10-081-7/+33
| | | | llvm-svn: 83548
* Improve checking for specializations of member classes of classDouglas Gregor2009-10-081-5/+44
| | | | | | | | | | | 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-6/+17
| | | | | | | | 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
* Only perform an implicit instantiation of a function if its templateDouglas Gregor2009-10-081-0/+6
| | | | | | | | | specialization kind is TSK_ImplicitInstantiation. Previously, we would end up implicitly instantiating functions that had explicit specialization declarations or explicit instantiation declarations (with no corresponding definitions). llvm-svn: 83511
* Type checking for specializations of member functions of classDouglas Gregor2009-10-071-5/+9
| | | | | | | | templates. Previously, these weren't handled as specializations at all. The AST for representing these as specializations is still a work in progress. llvm-svn: 83498
* Diagnose explicit instantiations and specializations that occur in class scopeDouglas Gregor2009-10-071-0/+6
| | | | llvm-svn: 83473
* Class template partial specializations can be declared anywhere thatDouglas Gregor2009-10-071-0/+20
| | | | | | | | | | 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
* More testing of explicit specializationsDouglas Gregor2009-10-071-15/+25
| | | | llvm-svn: 83440
* Refactor checking of the scope of explicit template specializationDouglas Gregor2009-10-072-1/+117
| | | | | | | | | declarations and explicit template instantiations, improving diagnostics and making the code usable for function template specializations (as well as class template specializations and partial specializations). llvm-svn: 83436
* Test explicit specialization for all of the various cases whereDouglas Gregor2009-10-061-0/+97
| | | | | | | explicit specializations can occur. Also, fix a minor recovery bug where we should allow declarations coming from the parser to be NULL. llvm-svn: 83416
* Improve template argument deduction in the case where the parameterDouglas Gregor2009-09-301-1/+3
| | | | | | | | | type is a template-id (e.g., basic_ostream<CharT, Traits>) and the argument type is a class that has a derived class matching the parameter type. Previously, we were giving up on template argument deduction too early. llvm-svn: 83177
* Make sure that out-of-line function and variable definitions are notDouglas Gregor2009-09-281-0/+17
| | | | | | pushed into scope. Fixes PR5056. llvm-svn: 83003
* Rework the Parse-Sema interaction for friends to better support friendDouglas Gregor2009-09-261-1/+3
| | | | | | | | | class templates. We now treat friend class templates much more like normal class templates, except that they still get special name lookup rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in <iostream>. llvm-svn: 82848
* Improved representation and support for friend class templates. Angst about ↵John McCall2009-09-162-2/+18
| | | | | | same. llvm-svn: 82088
* Slightly improved template argument deduction for use in partialDouglas Gregor2009-09-151-0/+16
| | | | | | | ordering, along with another test case for partial ordering of partial specializations. llvm-svn: 81869
* Skeletal support for friend class templates.John McCall2009-09-141-0/+6
| | | | llvm-svn: 81801
* Refactor MarkDeductedTemplateParameters intoDouglas Gregor2009-09-141-2/+14
| | | | | | | | MarkUsedTemplateParameters, which is able to mark template parameters used within non-deduced contexts as well as deduced contexts. Use this to finish the implementation of [temp.deduct.partial]p11. llvm-svn: 81794
* Tighten up checking of non-dependent arguments as part of templateDouglas Gregor2009-09-141-0/+10
| | | | | | | | | argument deduction. This fixes the new test case (since partial ordering does not have a "verify the results of deduction" step), and will allow failed template argument deductions to return more quickly for, e.g., matching class template partial specializations. llvm-svn: 81779
* Implement partial ordering of function template specializations Douglas Gregor2009-09-142-0/+35
| | | | | | (C++ [temp.func.order]). llvm-svn: 81777
* When performing name lookup within a class template or class templateDouglas Gregor2009-09-111-0/+43
| | | | | | | partial specialization, make sure we look into non-dependent base classes (but not dependent base classes). Fixes PR4951. llvm-svn: 81584
* Support templateids in friend declarations. Fixes bug 4859.John McCall2009-09-081-0/+5
| | | | llvm-svn: 81233
* Borrow a friend class's previous declaration's access specifier regardless ofJohn McCall2009-09-021-0/+3
| | | | | | | | whether the current context is dependent. Thanks to Anders for pointing this out. llvm-svn: 80828
* Fix a little crasher in friend decls. Thanks again to Eli for finding this.John McCall2009-09-021-0/+4
| | | | llvm-svn: 80748
* Fix a last-minute typo and make the test not emit temporaries.John McCall2009-08-291-2/+2
| | | | llvm-svn: 80419
* Ensure code generation for friend declarations in class templates.John McCall2009-08-291-2/+2
| | | | llvm-svn: 80418
* Omnibus friend decl refactoring. Instead of cloning AST classes for friendJohn McCall2009-08-281-3/+27
| | | | | | | | | | | | | | 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
* When checking whether one declaration context encloses another, make sure to ↵Douglas Gregor2009-08-271-0/+3
| | | | | | look at the primary contexts. Thanks to Eli for the test case llvm-svn: 80212
* Improve diagnostics and recovery when the nested-name-specifier of aDouglas Gregor2009-08-261-1/+1
| | | | | | | | | | | | qualified name does not actually refer into a class/class template/class template partial specialization. Improve printing of nested-name-specifiers to eliminate redudant qualifiers. Also, make it possible to output a nested-name-specifier through a DiagnosticBuilder, although there are relatively few places that will use this leeway. llvm-svn: 80056
* Eli points out that we really must diagnose "void* > 0" as an extension. Chris Lattner2009-08-231-1/+1
| | | | | | | Explicitly add it as an EXTENSION instead of an EXTWARN so that it only comes out with -pedantic. Thanks Eli! llvm-svn: 79791
* Implement delayed parsing for member function templates. Fixes PR4608.Douglas Gregor2009-08-221-12/+8
| | | | llvm-svn: 79709
* Implement conversion function templates, along with the ability to useDouglas Gregor2009-08-213-0/+114
| | | | | | | template argument deduction from a conversion function (C++ [temp.deduct.conv]) with implicit conversions. llvm-svn: 79693
OpenPOWER on IntegriCloud