summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/temp_arg_template.cpp
Commit message (Collapse)AuthorAge
* Richard makes a good point, clean up this test.David Majnemer2013-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189444 91177308-0d34-0410-b5e6-96231b3b80d8
* Some of this test doesn't want -std=c++11David Majnemer2013-08-28
| | | | | | | Sorry for the churn. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189429 91177308-0d34-0410-b5e6-96231b3b80d8
* This test now needs C++11David Majnemer2013-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189425 91177308-0d34-0410-b5e6-96231b3b80d8
* AST: Don't treat a TemplateExpansion as a TemplateDavid Majnemer2013-08-28
| | | | | | | | | | | | | | | | | | | Summary: Instead of calling getAsTemplate(), call getAsTemplateOrTemplatePattern() because it handles the TemplateExpansion case too. This fixes PR16997. Reviewers: doug.gregor, rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1512 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189422 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct test from r152189.Eli Friedman2012-03-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152191 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure we consistently canonicalize types when canonicalizing ↵Eli Friedman2012-03-07
| | | | | | TemplateTemplateParmDecls. PR12179. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152189 91177308-0d34-0410-b5e6-96231b3b80d8
* Detect when the string "<::" is found in code after a cast or template name ↵Richard Smith2011-04-14
| | | | | | | | | | and is interpreted as "[:" because of the digraph "<:". When found, give an error with a fix-it to add whitespace between the "<" and "::". Patch by Richard Trieu! Plus a small tweak from me to deal with one of the tokens coming from a macro. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129540 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some incorrect assertions when deduction template arguments inDouglas Gregor2010-08-06
| | | | | | | | | a template-argument-list. When template template parameters are involved, we won't already have checked the template-argument-list (it may not be known yet!). Fixes PR7807. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110444 91177308-0d34-0410-b5e6-96231b3b80d8
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-15
| | | | | | | | | - 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new representation for template templateDouglas Gregor2009-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | parameters. Rather than storing them as either declarations (for the non-dependent case) or expressions (for the dependent case), we now (always) store them as TemplateNames. The primary change here is to add a new kind of TemplateArgument, which stores a TemplateName. However, making that change ripples to every switch on a TemplateArgument's kind, also affecting TemplateArgumentLocInfo/TemplateArgumentLoc, default template arguments for template template parameters, type-checking of template template arguments, etc. This change is light on testing. It should fix several pre-existing problems with template template parameters, such as: - the inability to use dependent template names as template template arguments - template template parameter default arguments cannot be instantiation However, there are enough pieces missing that more implementation is required before we can adequately test template template parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86777 91177308-0d34-0410-b5e6-96231b3b80d8
* Improved semantic analysis and AST respresentation for functionDouglas Gregor2009-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | templates. For example, this now type-checks (but does not instantiate the body of deref<int>): template<typename T> T& deref(T* t) { return *t; } void test(int *ip) { int &ir = deref(ip); } Specific changes/additions: * Template argument deduction from a call to a function template. * Instantiation of a function template specializations (just the declarations) from the template arguments deduced from a call. * FunctionTemplateDecls are stored directly in declaration contexts and found via name lookup (all forms), rather than finding the FunctionDecl and then realizing it is a template. This is responsible for most of the churn, since some of the core declaration matching and lookup code assumes that all functions are FunctionDecls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename clang to clang-cc.Daniel Dunbar2009-03-24
| | | | | | | Tests and drivers updated, still need to shuffle dirs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement parsing of nested-name-specifiers that involve template-ids, e.g.,Douglas Gregor2009-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::vector<int>::allocator_type When we parse a template-id that names a type, it will become either a template-id annotation (which is a parsed representation of a template-id that has not yet been through semantic analysis) or a typename annotation (where semantic analysis has resolved the template-id to an actual type), depending on the context. We only produce a type in contexts where we know that we only need type information, e.g., in a type specifier. Otherwise, we create a template-id annotation that can later be "upgraded" by transforming it into a typename annotation when the parser needs a type. This occurs, for example, when we've parsed "std::vector<int>" above and then see the '::' after it. However, it means that when writing something like this: template<> class Outer::Inner<int> { ... }; We have two tokens to represent Outer::Inner<int>: one token for the nested name specifier Outer::, and one template-id annotation token for Inner<int>, which will be passed to semantic analysis to define the class template specialization. Most of the churn in the template tests in this patch come from an improvement in our error recovery from ill-formed template-ids. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65467 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement semantic checking for template arguments that correspond toDouglas Gregor2009-02-11
| | | | | | | | | | pointer-to-member-data non-type template parameters. Also, get consistent about what it means to returned a bool from CheckTemplateArgument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64305 91177308-0d34-0410-b5e6-96231b3b80d8
* Check template template arguments against their corresponding templateDouglas Gregor2009-02-10
template parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64188 91177308-0d34-0410-b5e6-96231b3b80d8