summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp/temp.decls/temp.variadic
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash on init-capture packs where the type of the initializer is ↵Richard Smith2019-12-191-0/+8
| | | | non-dependent.
* [c++20] P0780R2: Support pack-expansion of init-captures.Richard Smith2019-05-211-0/+39
| | | | | | | | | | | This permits an init-capture to introduce a new pack: template<typename ...T> auto x = [...a = T()] { /* a is a pack */ }; To support this, the mechanism for allowing ParmVarDecls to be packs has been extended to support arbitrary local VarDecls. llvm-svn: 361300
* [c++20] Implement P0428R2 - Familiar template syntax for generic lambdasHamza Sood2019-05-041-6/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D36527 llvm-svn: 359967
* Do not look through pack expansions when looking for unexpanded parameter packs.Richard Smith2017-08-151-0/+98
| | | | | | | Fixes a selection of rejects-valids when pack-expanding a lambda that itself contains a pack expansion. llvm-svn: 310972
* Fix hole in our enforcement of rule requiring 'typename' prior to a dependentRichard Smith2017-02-011-1/+1
| | | | | | | | | | | name. If the dependent name happened to end in a template-id (X<T>::Y<U>), we would fail to notice that the 'typename' keyword is missing when resolving it to a type. It turns out that GCC has a similar bug. If this shows up in much real code, we can easily downgrade this to an ExtWarn. llvm-svn: 293815
* DR1495: A partial specialization is ill-formed if it is not (strictly) moreRichard Smith2016-12-271-2/+2
| | | | | | | | specialized than the primary template. (Put another way, if we imagine there were a partial specialization matching the primary template, we should never select it if some other partial specialization also matches.) llvm-svn: 290593
* [Sema] Fix a bug where pack expansion was not expanded in type aliasErik Pilkington2016-07-051-0/+32
| | | | | | | | | | The problem is that the parameter pack in a function type type alias is not reexpanded after being transformed. Also remove an incorrect comment in a similar function. Fixes PR26017. Differential Revision: http://reviews.llvm.org/D21030 llvm-svn: 274566
* PR21531: fix crash on invalid with unexpanded pack in case value.Richard Smith2014-11-201-0/+1
| | | | llvm-svn: 222400
* Towards PR21289: don't lose track of unexpanded parameter packs withRichard Smith2014-10-171-0/+14
| | | | | | | non-dependent types, in CXXScalarValueInitExprs and in the nested-name-specifier or template arguments of a DeclRefExpr in particular. llvm-svn: 220028
* Reject varargs '...' in function prototype if there are more parameters afterRichard Smith2014-08-111-1/+1
| | | | | | | | | | | it. Diagnose with recovery if it appears after a function parameter that was obviously supposed to be a parameter pack. Otherwise, warn if it immediately follows a function parameter pack, because the user most likely didn't intend to write a parameter pack followed by a C-style varargs ellipsis. This warning can be syntactically disabled by using ", ..." instead of "...". llvm-svn: 215408
* PR18401: Fix assert by implementing the current proposed direction of coreRichard Smith2014-01-091-3/+12
| | | | | | | issue 1430. Don't allow a pack expansion to be used as an argument to an alias template unless the corresponding parameter is a parameter pack. llvm-svn: 198833
* Eliminate UnaryTypeTraitExprAlp Toker2014-01-011-1/+1
| | | | | | | | | | | | | Remove UnaryTypeTraitExpr and switch all remaining type trait related handling over to TypeTraitExpr. The UTT/BTT/TT enum prefix and evaluation code is retained pending further cleanup. This is part of the ongoing work to unify type traits following the removal of BinaryTypeTraitExpr in r197273. llvm-svn: 198271
* Eliminate BinaryTypeTraitExprAlp Toker2013-12-131-1/+1
| | | | | | | | | | | | | | | | | There's nothing special about type traits accepting two arguments. This commit eliminates BinaryTypeTraitExpr and switches all related handling over to TypeTraitExpr. Also fixes a CodeGen failure with variadic type traits appearing in a non-constant expression. The BTT/TT prefix and evaluation code is retained as-is for now but will soon be further cleaned up. This is part of the ongoing work to unify type traits. llvm-svn: 197273
* Regression test for PR12699Serge Pavlov2013-08-051-0/+26
| | | | llvm-svn: 187734
* Fix to PR12262 - assertion when substituting explicit template argumentsSerge Pavlov2013-07-151-0/+177
| | | | | | | | does not substitute a sizeof-pack expression. The solution is proposed by Richard Smith. Differential Revision: http://llvm-reviews.chandlerc.com/D869 llvm-svn: 186306
* DebugInfo: Support (using GNU extensions) for template template parameters ↵David Blaikie2013-06-221-1/+1
| | | | | | and parameter packs llvm-svn: 184644
* Add a couple more tests.Eli Friedman2013-06-201-0/+1
| | | | llvm-svn: 184501
* Include the unexpanded packs in the initializer expression when checking aNick Lewycky2013-06-131-0/+11
| | | | | | pack expanded constructor initializer list. Fixes PR16303! llvm-svn: 183878
* The 'constexpr implies const' rule for non-static member functions is gone inRichard Smith2013-04-211-5/+5
| | | | | | | | | C++1y, so stop adding the 'const' there. Provide a compatibility warning for code relying on this in C++11, with a fix-it hint. Update our lazily-written tests to add the const, except for those ones which were testing our implementation of this rule. llvm-svn: 179969
* Refactor to call ActOnFinishFullExpr on every full expression. TeachRichard Smith2013-01-142-0/+18
| | | | | | | | ActOnFinishFullExpr that some of its checks only apply to discarded-value expressions. This adds missing checks for unexpanded variadic template parameter packs to a handful of constructs. llvm-svn: 172485
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-196-0/+6
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* PR13811: Add a FunctionParmPackExpr node to handle references to functionRichard Smith2012-09-121-0/+24
| | | | | | | parameter packs where the reference is not being expanded but the pack has been. Previously, Clang would segfault in such cases. llvm-svn: 163672
* PR13386: When matching up parameters between a function template declarationRichard Smith2012-07-181-0/+43
| | | | | | | | | | | and a function template instantiation, if there's a parameter pack in the declaration and one at the same place in the instantiation, don't assume that the pack wasn't expanded -- it may have expanded to nothing. Instead, go ahead and check whether the parameter pack was expandable. We can do this as a side-effect of the work we'd need to do anyway, to find how many parameters were produced. llvm-svn: 160416
* Implement the last part of C++ [class.mem]p2, delaying the parsing ofDouglas Gregor2012-04-161-1/+1
| | | | | | | | | exception specifications on member functions until after the closing '}' for the containing class. This allows, for example, a member function to throw an instance of its own class. Fixes PR12564 and a fairly embarassing oversight in our C++98/03 support. llvm-svn: 154844
* PR11850 + duplicates: don't assume that a function parameter pack expansion isRichard Smith2012-03-131-0/+46
| | | | | | at the end of the parameter list. llvm-svn: 152618
* Improve diagnostics a bit for bad member initializers, and fix an obscure ↵Eli Friedman2012-02-221-0/+10
| | | | | | bug involving packs. Fixes PR12049. llvm-svn: 151130
* Represent C++ direct initializers as ParenListExprs before semantic analysisSebastian Redl2012-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of having a special-purpose function. - ActOnCXXDirectInitializer, which was mostly duplication of AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days ago), is dropped completely. - MultiInitializer, which was an ugly hack I added, is dropped again. - We now have the infrastructure in place to distinguish between int x = {1}; int x({1}); int x{1}; -- VarDecl now has getInitStyle(), which indicates which of the above was used. -- CXXConstructExpr now has a flag to indicate that it represents list- initialization, although this is not yet used. - InstantiateInitializer was renamed to SubstInitializer and simplified. - ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which always produces a ParenListExpr. Placed that so far failed to convert that back to a ParenExpr containing comma operators have been fixed. I'm pretty sure I could have made a crashing test case before this. The end result is a (I hope) considerably cleaner design of initializers. More importantly, the fact that I can now distinguish between the various initialization kinds means that I can get the tricky generalized initializer test cases Johannes Schaub supplied to work. (This is not yet done.) This commit passed self-host, with the resulting compiler passing the tests. I hope it doesn't break more complicated code. It's a pretty big change, but one that I feel is necessary. llvm-svn: 150318
* When a pack expansion occurs in the template argument list of an aliasDouglas Gregor2012-02-031-0/+7
| | | | | | | | template without a corresponding parameter pack, don't immediately substitute the alias template. This is under discussion in the C++ committee, and may become ill-formed, but for now we match GCC. llvm-svn: 149697
* Implement support for a pack expansion into a fixed-lengthDouglas Gregor2012-02-031-0/+120
| | | | | | | | | template. Such pack expansions can easily fail at template instantiation time, if the expanded parameter packs are of the wrong length. Fixes <rdar://problem/10040867>, PR9021, and the example that came up today at Going Native. llvm-svn: 149685
* Tweak the fix to PR8977: an empty expression-list represents value ↵Eli Friedman2012-01-051-1/+2
| | | | | | initialization, not default initialization. Fixes PR11712. llvm-svn: 147620
* Remove a non-gcc-compatible extension that would apply attributes on ↵Eli Friedman2011-12-171-2/+1
| | | | | | declarations without a declarator to structs. Add a warning for ignored attributes. Patch by Michael Han. llvm-svn: 146796
* Fix grammar for C++11 alignment specifiers, and add a few FIXMEs.Peter Collingbourne2011-10-231-1/+2
| | | | llvm-svn: 142760
* Diagnose unexpanded parameter packs in member initialisers (includingPeter Collingbourne2011-10-231-0/+6
| | | | | | in-class member initialisers). llvm-svn: 142758
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-1314-14/+14
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* When substituting into a sizeof parameter pack expression in a contextDouglas Gregor2011-10-101-0/+15
| | | | | | | where we can't expand (i.e., multi-level substitution), be sure to substitute the pack with its level-reduced pack. Fixes PR10230. llvm-svn: 141568
* Declare and define implicit move constructor and assignment operator.Sebastian Redl2011-08-301-0/+1
| | | | | | | | | This makes the code duplication of implicit special member handling even worse, but the cleanup will have to come later. For now, this works. Follow-up with tests for explicit defaulting and enabling the __has_feature flag to come. llvm-svn: 138821
* Diagnose unexpanded parameter packs in return statements. ThisDouglas Gregor2011-05-201-0/+7
| | | | | | | manifested in a crash with blocks in PR9953, but it was a ticking time bomb for normal functions, too. Fixes PR9953. llvm-svn: 131731
* Add support for C++0x's range-based for loops, as specified by the C++11 ↵Richard Smith2011-04-141-0/+4
| | | | | | draft standard (N3291). llvm-svn: 129541
* Semantic checking for exception specifications should be triggered byJohn McCall2011-03-021-1/+1
| | | | | | whether C++ exceptions are enabled, not exceptions in general. PR9358. llvm-svn: 126820
* When we're substituting into a parameter-type-list nested inside the patternDouglas Gregor2011-03-021-0/+18
| | | | | | | | of an expansion, and we have a paramameter that is not a parameter pack, don't suppress substitution of parameter packs within this context. llvm-svn: 126819
* Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson2011-02-281-1/+1
| | | | llvm-svn: 126599
* Pass -fexceptions to all tests that use try/catch/throw.Anders Carlsson2011-02-191-1/+1
| | | | llvm-svn: 126037
* Implement basic support for the use of variadic templates and blocksDouglas Gregor2011-01-191-0/+39
| | | | | | | | | | | | | | | | | together. In particular: - Handle the use of captured parameter pack names within blocks (BlockDeclRefExpr understands parameter packs now) - Handle the declaration and expansion of parameter packs within a block's parameter list, e.g., ^(Args ...args) { ... }) - Handle instantiation of blocks where the return type was not explicitly specified. (unrelated, but necessary for my tests). Together, these fixes should make blocks and variadic templates work reasonably well together. Note that BlockDeclRefExpr is still broken w.r.t. its computation of type and value dependence, which will still cause problems for blocks in templates. llvm-svn: 123849
* Implement support for non-type template parameter packs whose type isDouglas Gregor2011-01-191-2/+42
| | | | | | | | | | | | | | | | | | | | | a pack expansion, e.g., the parameter pack Values in: template<typename ...Types> struct Outer { template<Types ...Values> struct Inner; }; This new implementation approach introduces the notion of an "expanded" non-type template parameter pack, for which we have already expanded the types of the parameter pack (to, say, "int*, float*", for Outer<int*, float*>) but have not yet expanded the values. Aside from creating these expanded non-type template parameter packs, this patch updates template argument checking and non-type template parameter pack instantiation to make use of the appropriate types in the parameter pack. llvm-svn: 123845
* Tweak the partial ordering rules for function templates to prefer aDouglas Gregor2011-01-161-5/+3
| | | | | | | | non-variadic function template over a variadic one. This matches GCC and the intent of the C++0x wording, in a way that I think is likely to be acceptable to the committee. llvm-svn: 123581
* Introduce a new kind of TemplateName that captures a substitutedDouglas Gregor2011-01-151-0/+26
| | | | | | | | | | | | | | | template template parameter pack that cannot be fully expanded because its enclosing pack expansion could not be expanded. This form of TemplateName plays the same role as SubstTemplateTypeParmPackType and SubstNonTypeTemplateParmPackExpr do for template type parameter packs and non-type template parameter packs, respectively. We should now handle these multi-level pack expansion substitutions anywhere. The largest remaining gap in our variadic-templates support is that we cannot cope with non-type template parameter packs whose type is a pack expansion. llvm-svn: 123521
* Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr,Douglas Gregor2011-01-151-0/+23
| | | | | | | | | that captures the substitution of a non-type template argument pack for a non-type template parameter pack within a pack expansion that cannot be fully expanded. This follows the approach taken by SubstTemplateTypeParmPackType. llvm-svn: 123506
* Teach template template argument pack expansions to keep track of theDouglas Gregor2011-01-141-0/+38
| | | | | | | number of expansions, when we know it, and propagate that information through Sema. llvm-svn: 123493
* Handle substitutions into function parameter packs whose patternsDouglas Gregor2011-01-141-0/+22
| | | | | | contain multiple parameter packs at different levels. llvm-svn: 123488
* Teach PackExpansionExpr to keep track of the number of pack expansionsDouglas Gregor2011-01-141-0/+29
| | | | | | it will expand to, if known. Propagate this information throughout Sema. llvm-svn: 123470
OpenPOWER on IntegriCloud