summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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
* Argument-dependent lookup for friend declarations. Add a new decl type,John McCall2009-08-111-0/+42
| | | | | | | | | | | | FriendFunctionDecl, and create instances as appropriate. The design of FriendFunctionDecl is still somewhat up in the air; you can befriend arbitrary types of functions --- methods, constructors, etc. --- and it's not clear that this representation captures that very well. We'll have a better picture when we start consuming this data in access control. llvm-svn: 78653
* Permit a class to friend its members in C++0x, without restriction.John McCall2009-08-061-2/+2
| | | | | | | Permit a class to friend its class members in C++ 98, as long as extensions are enabled (and even when they aren't, only give an extwarn about it). llvm-svn: 78332
* 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
* First pass at friend semantics.John McCall2009-08-064-3/+78
| | | | llvm-svn: 78274
* AlisdairM pointed out that this will likely be relaxed in C++0x, so let'sJohn McCall2009-08-061-0/+3
| | | | | | make a note of it in the test case. llvm-svn: 78266
* Add a test for invalid uses of non-static members from nested classes, justJohn McCall2009-08-051-0/+11
| | | | | | because I was thinking about it. llvm-svn: 78262
* 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-279-9/+9
| | | | llvm-svn: 77249
* Make having no RUN line a failure.Daniel Dunbar2009-07-252-1/+6
| | | | | | | 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
* Semantic checking for main().John McCall2009-07-257-0/+39
| | | | | | | Fix some invalid main() methods in the test suite that were nicely exposed by the new checks. llvm-svn: 77047
* 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
* Prep for new warning.Mike Stump2009-07-221-1/+1
| | | | llvm-svn: 76772
* "This patch implements the restrictions on union members detailed inDouglas Gregor2009-07-221-0/+105
| | | | | | [class.union]p1", from John McCall! llvm-svn: 76766
* 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
* Revert this, we have a better way to do this.Mike Stump2009-07-211-4/+1
| | | | llvm-svn: 76687
* Revert this, we have a better way to handle this.Mike Stump2009-07-211-4/+1
| | | | llvm-svn: 76685
* Prep for new warning.Mike Stump2009-07-211-3/+3
| | | | llvm-svn: 76640
* Prep for new warning.Mike Stump2009-07-211-2/+5
| | | | llvm-svn: 76628
* Prep for new warning.Mike Stump2009-07-211-1/+4
| | | | llvm-svn: 76627
* Fix test case to match intent.Daniel Dunbar2009-07-111-1/+1
| | | | llvm-svn: 75381
* Add another test.Anders Carlsson2009-07-111-0/+10
| | | | llvm-svn: 75324
* Implement more of C++0x 'auto'. A variable with an auto type specifier must ↵Anders Carlsson2009-07-111-0/+0
| | | | | | have an initializer. Also, move some tests around to match the C++0x draft better. llvm-svn: 75322
* Another little test for C++ [over.over]Douglas Gregor2009-07-091-0/+10
| | | | llvm-svn: 75151
* Add test for C++ [over.over.]p1, the contexts in which one can take the ↵Douglas Gregor2009-07-091-0/+94
| | | | | | address of an overloaded function. llvm-svn: 75146
* Store the isAddressOfOperand in the UnresolvedDeclRefExpr, so that we can ↵Anders Carlsson2009-07-091-1/+7
| | | | | | pass it when instantiating the expr. Fixes another member pointer bug. llvm-svn: 75075
* Implement the simple form of overload resolution used when taking theDouglas Gregor2009-07-081-0/+23
| | | | | | | address of an overloaded function (which may involve both functions and function templates). llvm-svn: 75069
* It's not allowed to form member pointers to members that have reference ↵Anders Carlsson2009-07-081-0/+20
| | | | | | type. Add a test for this and the rest of [dcl.mptr]p3. llvm-svn: 75054
* 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
* Fix a corner case with argument-dependent lookup and overloaded function sets.Douglas Gregor2009-07-081-0/+11
| | | | llvm-svn: 74999
* Improve argument-dependent lookup to find associated classes andDouglas Gregor2009-07-082-0/+89
| | | | | | | namespaces based on the template arguments of a class template specialization type. llvm-svn: 74993
* Overload resolution prefers non-templates to templatesDouglas Gregor2009-07-071-0/+16
| | | | llvm-svn: 74971
* 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
OpenPOWER on IntegriCloud