summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/temp_arg_template.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Richard makes a good point, clean up this test.David Majnemer2013-08-281-8/+3
| | | | llvm-svn: 189444
* Some of this test doesn't want -std=c++11David Majnemer2013-08-281-1/+6
| | | | | | Sorry for the churn. llvm-svn: 189429
* This test now needs C++11David Majnemer2013-08-281-1/+1
| | | | llvm-svn: 189425
* AST: Don't treat a TemplateExpansion as a TemplateDavid Majnemer2013-08-281-0/+11
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 189422
* Correct test from r152189.Eli Friedman2012-03-071-1/+1
| | | | llvm-svn: 152191
* Make sure we consistently canonicalize types when canonicalizing ↵Eli Friedman2012-03-071-0/+6
| | | | | | TemplateTemplateParmDecls. PR12179. llvm-svn: 152189
* Detect when the string "<::" is found in code after a cast or template name ↵Richard Smith2011-04-141-3/+6
| | | | | | | | 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. llvm-svn: 129540
* Remove some incorrect assertions when deduction template arguments inDouglas Gregor2010-08-061-0/+18
| | | | | | | | 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. llvm-svn: 110444
* 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
* Introduce a new representation for template templateDouglas Gregor2009-11-111-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 86777
* Improved semantic analysis and AST respresentation for functionDouglas Gregor2009-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 74213
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Implement parsing of nested-name-specifiers that involve template-ids, e.g.,Douglas Gregor2009-02-251-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 65467
* Implement semantic checking for template arguments that correspond toDouglas Gregor2009-02-111-1/+2
| | | | | | | | pointer-to-member-data non-type template parameters. Also, get consistent about what it means to returned a bool from CheckTemplateArgument. llvm-svn: 64305
* Check template template arguments against their corresponding templateDouglas Gregor2009-02-101-0/+42
template parameters. llvm-svn: 64188
OpenPOWER on IntegriCloud