summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/alias-templates.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Factor out common code for diagnosing missing template arguments.Richard Smith2018-04-261-2/+4
| | | | | | In passing, add 'concept' to the list of template kinds in diagnostics. llvm-svn: 330890
* Give more accurate descriptions of what kind of template we found in ↵Richard Smith2017-01-141-0/+11
| | | | | | | | | diagnostics. We were previouly assuming that every type template was a class template, which is not true any more. llvm-svn: 291988
* PR31514: Add recursive self-instantiation check during template argumentRichard Smith2017-01-081-0/+10
| | | | | | | | | | | deduction in partial ordering. This prevents us from crashing due to attempting to instantiate the same class template specialization definition multiple times. (Debug builds also appear to sometimes hit the stack limit before hitting the instantiation depth limit in this case.) llvm-svn: 291407
* Add optimization to sizeof...(X) handling: if none of parameter pack X'sRichard Smith2016-10-191-0/+17
| | | | | | | | | | | | | | | | | | | | | corresponding arguments are unexpanded pack expansions, we can compute the result without substituting them. This significantly improves the memory usage and performance of make_integer_sequence implementations that do this kind of thing: using result = integer_sequence<T, Ns ..., sizeof...(Ns) + Ns ...>; ... but note that such an implementation will still perform O(sizeof...(Ns)^2) work while building the second pack expansion (we just have a somewhat lower constant now). In principle we could get this down to linear time by caching whether the number of expansions of a pack is constant, or checking whether we're within an alias template before scanning the pack for pack expansions (since that's the only case in which we do substitutions within a dependent context at the moment), but this patch doesn't attempt that. llvm-svn: 284653
* Push alias-declarations and alias-template declarations into scope even ifRichard Smith2016-07-151-0/+6
| | | | | | | | they're redeclarations. This is necessary in order for name lookup to correctly find the most recent declaration of the name (which affects default template argument lookup and cross-module merging, among other things). llvm-svn: 275612
* PR14858: Initial support for proper sizeof... handling within alias templates.Richard Smith2015-09-231-0/+20
| | | | | | | This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently give the wrong answers. llvm-svn: 248431
* Fix for dependent contexts in alias templates.Eli Friedman2013-08-151-0/+12
| | | | | | | | | | When we are parsing a type for an alias template, we are not entering the context, so we can't look into dependent classes. Make sure the parser handles this correctly. PR16904. llvm-svn: 188510
* FIXME fix: improving diagnostics for template arguments deduction of class ↵Larisse Voufo2013-07-191-7/+0
| | | | | | | | templates and explicit specializations This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info. llvm-svn: 186730
* Fix pack instantiation with function types.Eli Friedman2013-07-191-0/+7
| | | | | | | Make sure we correctly expand packs which expand to another pack in a function type. llvm-svn: 186728
* Fix for template substitution with packs.Eli Friedman2013-07-191-0/+23
| | | | | | | | | | When we see a pack, and replace it with a template argument which is also a pack, we want to use the pack pattern, not the expanded pack. The caller should take care of expanding the pack afterwards. Fixes PR16646. llvm-svn: 186713
* More for PR11848: a pack expansion type isn't necessarily type-dependent (itsRichard Smith2012-07-161-9/+9
| | | | | | | pattern might be an alias template which doesn't use its arguments). It's always instantiation-dependent, though. llvm-svn: 160246
* Related to PR11848 and core-21989: switch ContainsUnexpandedParameterPack fromRichard Smith2012-07-161-5/+43
| | | | | | | | | being a property of a canonical type to being a property of the fully-sugared type. This should only make a difference in the case where an alias template ignores one of its parameters, and that parameter is an unexpanded parameter pack. llvm-svn: 160244
* PR13136:Richard Smith2012-07-091-0/+19
| | | | | | | | | | | | | | | * When substituting a reference to a non-type template parameter pack where the corresponding argument is a pack expansion, transform into an expression which contains an unexpanded parameter pack rather than into an expression which contains a pack expansion. This causes the SubstNonTypeTemplateParmExpr to be inside the PackExpansionExpr, rather than outside, so the expression still looks like a pack expansion and can be deduced. * Teach MarkUsedTemplateParameters that we can deduce a reference to a template parameter if it's wrapped in a SubstNonTypeTemplateParmExpr (such nodes are added during alias template substitution). llvm-svn: 159922
* PR13243: When deducing a non-type template parameter which is specified as anRichard Smith2012-07-081-0/+9
| | | | | | | | expression, skip over any SubstNonTypeTemplateParmExprs which alias templates may have inserted before checking for a DeclRefExpr referring to a non-type template parameter declaration. llvm-svn: 159909
* When we're substituting into a function parameter pack and expect toDouglas Gregor2012-01-251-3/+2
| | | | | | | get a function parameter pack (but don't due to weird substitutions), complain. Fixes the last bit of PR11848. llvm-svn: 148960
* Fix PR11848: decree that an alias template contains an unexpanded parameter packRichard Smith2012-01-251-0/+33
| | | | | | | | | | | | | iff its substitution contains an unexpanded parameter pack. This has the effect that we now reject declarations such as this (which we used to crash when expanding): template<typename T> using Int = int; template<typename ...Ts> void f(Int<Ts> ...ints); The standard is inconsistent on how this case should be treated. llvm-svn: 148905
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* PR9908: Fix the broken fix for PR9902 to get the template argument lists in ↵Richard Smith2011-05-141-0/+70
the right order. Also, don't reject alias templates in all ElaboratedTypes: some ElaboratedTypes do not correspond to elaborated-type-specifiers. llvm-svn: 131342
OpenPOWER on IntegriCloud