summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-member-template.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When transforming a dependent template specialization type, make sureDouglas Gregor2011-03-071-0/+44
| | | | | | | | | to set the source-location information for the template arguments to the *transformed* source-location information, not the original source-location information. Fixes <rdar://problem/8986308> (a libc++ SFINAE issue) and the Boost.Polygon failure. llvm-svn: 127150
* Preserve the template type parameter name when instantiating a templace.Nick Lewycky2010-10-301-0/+12
| | | | | | Fixes PR8489. llvm-svn: 117776
* When template substitution into a template parameter reduces the levelDouglas Gregor2010-08-301-0/+14
| | | | | | | | | | | | of that parameter, reduce the level by the number of active template argument lists rather than by 1. The number of active template argument lists is only > 1 when we have a class template partial specialization of a member template of a class template that itself is a member template of another class template. ... and Boost.MSM does this. Fixes PR7669. llvm-svn: 112551
* When performing substitution of template arguments within the body ofDouglas Gregor2010-07-081-0/+33
| | | | | | | a template, be sure to include the template arguments from the injected-class-name. Fixes PR7587. llvm-svn: 107895
* Whenever we complain about a failed initialization of a function orDouglas Gregor2010-04-221-1/+1
| | | | | | | | | | | | | | | | | method parameter, provide a note pointing at the parameter itself so the user does not have to manually look for the function/method being called and match up parameters to arguments. For example, we now get: t.c:4:5: warning: incompatible pointer types passing 'long *' to parameter of type 'int *' [-pedantic] f(long_ptr); ^~~~~~~~ t.c:1:13: note: passing argument to parameter 'x' here void f(int *x); ^ llvm-svn: 102038
* Cope with finding the "instantiated" declaration when we areDouglas Gregor2010-02-051-0/+25
| | | | | | | | type-checking within a template definition. In this case, the "instantiated" declaration is just the declaration itself, found within the current instantiation. Fixes PR6239. llvm-svn: 95442
* Switch initialization of parameters in a call over toDouglas Gregor2009-12-221-1/+1
| | | | | | | | | | | InitializationSequence (when a FunctionDecl is present). This required a few small fixes to initialization sequences: - Make sure to use the adjusted parameter type for initialization of function parameters. - Implement transparent union calling semantics in C llvm-svn: 91902
* Switch the initialization required by return statements over to theDouglas Gregor2009-12-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-151-1/+1
| | | | | | | | | - 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
* Teach FixOverloadedFunctionReference to build new expression ASTs ratherDouglas Gregor2009-11-201-0/+15
| | | | | | | than tweaking existing ASTs, since we were (*gasp*) stomping on ASTs within templates. I'm glad we found this little stick of TNT early... llvm-svn: 89475
* Slightly more testing for instantiation of non-type template parameters in ↵Douglas Gregor2009-11-091-0/+13
| | | | | | nested templates, for my own sanity's sake llvm-svn: 86570
* Test instantiation of static data members that live within nestedDouglas Gregor2009-08-281-0/+9
| | | | | | member templates. llvm-svn: 80396
* Test instantiations of out-of-line member definitions of nested templates.Douglas Gregor2009-08-281-0/+19
| | | | llvm-svn: 80395
* Fix and test template instantiation for nested member templates.Douglas Gregor2009-08-281-1/+23
| | | | llvm-svn: 80394
* Tighten up the conversion from a single-level template argument listDouglas Gregor2009-08-281-1/+11
| | | | | | | | | | to a multi-level template argument list by making it explicit. The forced auditing of callers found a bug in the instantiation of member classes inside member templates. I *love* static type systems. llvm-svn: 80391
* Implement template instantiation for member class templates.Douglas Gregor2009-08-281-0/+22
| | | | | | | | | | 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-0/+1
| | | | | | | MultiLevelTemplateArgumentList. This is a baby step toward instantiating member templates; no intended functionality change yet. llvm-svn: 80380
* Implement instantiation of the declarations of member functionDouglas Gregor2009-08-271-0/+22
templates within class templates, producing a member function template of a class template specialization. If you can parse that, I'm sorry. Example: template<typename T> struct X { template<typename U> void f(T, U); }; When we instantiate X<int>, we now instantiate the declaration X<int>::f, which looks like this: template<typename U> void X<int>::f(int, U); The path this takes through TemplateDeclInstantiator::VisitCXXMethodDecl is convoluted and ugly, but I don't know how to improve it yet. I'm resting my hopes on the multi-level substitution required to instantiate definitions of nested templates, which may simplify this code as well. More testing to come... llvm-svn: 80252
OpenPOWER on IntegriCloud