summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/temp_arg_template.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR10147: When substituting a template template argument, substitute in the mostRichard Smith2017-08-291-0/+7
| | | | | | | recent (non-friend) declaration to pick up the right set of default template arguments. llvm-svn: 312049
* PR32185: Revert r291512 and add a testcase for PR32185.Richard Smith2017-04-131-3/+38
| | | | | | | | | | | | | | | This reverts an attempt to check that types match when matching a dependently-typed non-type template parameter. (This comes up when matching the parameters of a template template parameter against the parameters of a template template argument.) The matching rules here are murky at best. Our behavior after this revert is definitely wrong for certain C++17 features (for 'auto' template parameter types within the parameter list of a template template argument in particular), but our behavior before this revert is wrong for some pre-existing testcases, so reverting to our prior behavior seems like our best option. llvm-svn: 300262
* Check that template template arguments match template template parametersRichard Smith2017-01-091-0/+6
| | | | | | | | | | | | | | | properly even when a non-type template parameter has a dependent type. Previously, if a non-type template parameter was dependent, but not dependent on an outer level of template parameter, we would not match the type of the parameter. Under [temp.arg.template], we are supposed to check that the types are equivalent, which means checking for syntactic equivalence in the dependent case. This also fixes some accepts-invalids when passing templates with auto-typed non-type template parameters as template template arguments. llvm-svn: 291512
* [c++17] Implement P0522R0 as written. This allows a template template argumentRichard Smith2016-12-311-1/+3
| | | | | | | | | | | | | | | | | | | to be specified for a template template parameter whenever the parameter is at least as specialized as the argument (when there's an obvious and correct mapping from uses of the parameter to uses of the argument). For example, a template with more parameters can be passed to a template template parameter with fewer, if those trailing parameters have default arguments. This is disabled by default, despite being a DR resolution, as it's fairly broken in its current state: there are no partial ordering rules to cope with template template parameters that have different parameter lists, meaning that code that attempts to decompose template-ids based on arity can hit unavoidable ambiguity issues. The diagnostics produced on a non-matching argument are also pretty bad right now, but I aim to improve them in a subsequent commit. llvm-svn: 290792
* Fix assert hit when tree-transforming template template parameter packs.Manuel Klimek2016-01-111-1/+11
| | | | | | | | | Covers significantly more code in the template template pack argument test and fixes the resulting assert problem. Differential Revision: http://reviews.llvm.org/D15743 llvm-svn: 257326
* [Lit Test] Updated 20 Lit tests to be C++11 compatible.Charles Li2015-12-101-4/+21
| | | | | | | | This is the 5th Lit test patch. Expanded expected diagnostics to vary by C++ dialect. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 255196
* 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