summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp/temp.decls
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch the initialization required by return statements over to theDouglas Gregor2009-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | new InitializationSequence. This fixes some bugs (e.g., PR5808), changed some diagnostics, and caused more churn than expected. What's new: - InitializationSequence now has a "C conversion sequence" category and step kind, which falls back to - Changed the diagnostics for returns to always have the result type of the function first and the type of the expression second. CheckSingleAssignmentConstraints to peform checking in C. - Improved ASTs for initialization of return values. The ASTs now capture all of the temporaries we need to create, but intentionally do not bind the tempoary that is actually returned, so that it won't get destroyed twice. - Make sure to perform an (elidable!) copy of the class object that is returned from a class. - Fix copy elision in CodeGen to properly see through the subexpressions that occur with elidable copies. - Give "new" its own entity kind; as with return values and thrown objects, we don't bind the expression so we don't call a destructor for it. Note that, with this patch, I've broken returning move-only types in C++0x. We'll fix it later, when we tackle NRVO. llvm-svn: 91669
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-1520-20/+20
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Canonical template arguments that are template template parameters byDouglas Gregor2009-11-231-1/+22
| | | | | | | their template parameter depth and position, so that we can match redeclarations appropriately. Fixes PR5527 and PR5528. llvm-svn: 89654
* Cope with extraneous "template" keyword when providing an out-of-lineDouglas Gregor2009-11-202-1/+11
| | | | | | definition of a member template (or a member thereof). Fixes PR5566. llvm-svn: 89512
* Instantiate class template friends better; fixes PR5332.Douglas Gregor2009-10-301-0/+2
| | | | llvm-svn: 85612
* Implement support for semantic checking and template instantiation ofDouglas Gregor2009-10-291-2/+37
| | | | | | | | class template partial specializations of member templates. Also, fixes a silly little bug in the marking of "used" template parameters in member templates. Fixes PR5236. llvm-svn: 85447
* 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
* 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
* Implement partial ordering of function template specializations Douglas Gregor2009-09-142-0/+35
| | | | | | (C++ [temp.func.order]). llvm-svn: 81777
* 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
* 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-275-5/+5
| | | | llvm-svn: 77249
* 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 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
OpenPOWER on IntegriCloud