summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/issue150.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When substituting in for a template name, do not produce a qualifiedDouglas Gregor2011-03-051-2/+2
| | | | | | | | | | | | template name as the result of substitution. The qualifier is handled separately by the tree transformer, so we would end up in an inconsistent state. This is actually the last bit of PR9016, and possibly also fixes PR8965. It takes Boost.Icl from "epic fail" down to a single failure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127108 91177308-0d34-0410-b5e6-96231b3b80d8
* When determining template instantiation arguments within a functionDouglas Gregor2011-03-051-0/+10
| | | | | | | | | | | | template (not a specialization!), use the "injected" function template arguments, which correspond to the template parameters of the function template. This is required when substituting into the default template parameters of template template parameters within a function template. Fixes PR9016. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127092 91177308-0d34-0410-b5e6-96231b3b80d8
* When transforming a substituted template type parameter, try toDouglas Gregor2011-03-051-0/+26
| | | | | | | | | | | | | | | | | transform the type that replaces the template type parameter. In the vast majority of cases, there's nothing to do, because most template type parameters are replaced with something non-dependent that doesn't need further transformation. However, when we're dealing with the default template arguments of template template parameters, we might end up replacing a template parameter (of the template template parameter) with a template parameter of the enclosing template. This addresses part of PR9016, but not within function templates. That's a separate issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127091 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure to put template parameters into their owning template'sDouglas Gregor2011-03-041-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DeclContext once we've created it. This mirrors what we do for function parameters, where the parameters start out with translation-unit context and then are adopted by the appropriate DeclContext when it is created. Also give template parameters public access and make sure that they don't show up for the purposes of name lookup. Fixes PR9400, a regression introduced by r126920, which implemented substitution of default template arguments provided in template template parameters (C++ core issue 150). How on earth could the DeclContext of a template parameter affect the handling of default template arguments? I'm so glad you asked! The link is Sema::getTemplateInstantiationArgs(), which determines the outer template argument lists that correspond to a given declaration. When we're instantiating a default template argument for a template template parameter within the body of a template definition (not it's instantiation, per core issue 150), we weren't getting any outer template arguments because the context of the template template parameter was the translation unit. Now that the context of the template template parameter is its owning template, we get the template arguments from the injected-class-name of the owning template, so substitution works as it should. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127004 91177308-0d34-0410-b5e6-96231b3b80d8
* When we use the default template arguments of a template templateDouglas Gregor2011-03-031-0/+13
parameter, save the instantiated default template arguments along with the explicitly-specified template argument list. That way, we prefer the default template template arguments corresponding to the template template parameter rather than those of its template template argument. This addresses the likely direction of C++ core issue 150, and fixes PR9353/<rdar://problem/9069136>, bringing us closer to the behavior of EDG and GCC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126920 91177308-0d34-0410-b5e6-96231b3b80d8