summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [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
* 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
* 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
* Refactor to call ActOnFinishFullExpr on every full expression. TeachRichard Smith2013-01-141-0/+9
| | | | | | | | 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
* 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
* 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
* 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-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* 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
* 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
* Add testing for unexpanded parameter packs in all of the C++Douglas Gregor2011-01-111-1/+128
| | | | | | | | expression kinds. This is (indirectly) a test verifying that the recursive AST visitor is visiting the children of these expression nodes. llvm-svn: 123198
* Implement substitution of a function parameter pack for its set ofDouglas Gregor2011-01-071-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | instantiated function parameters, enabling instantiation of arbitrary pack expansions involving function parameter packs. At this point, we can now correctly compile a simple, variadic print() example: #include <iostream> #include <string> void print() {} template<typename Head, typename ...Tail> void print(const Head &head, const Tail &...tail) { std::cout << head; print(tail...); } int main() { std::string hello = "Hello"; print(hello, ", world!", " ", 2011, '\n'); } llvm-svn: 123000
* Implement support for template template parameter packs, e.g.,Douglas Gregor2011-01-051-0/+5
| | | | | | | template<template<class> class ...Metafunctions> struct apply_to_each; llvm-svn: 122874
* Properly rebuild pack expansions whose pattern is a non-type templateDouglas Gregor2011-01-031-1/+0
| | | | | | | argument. As part of this, be more careful when determining if there are any parameter packs that cannot be expanded. llvm-svn: 122776
* Diagnose the presence of unexpanded parameter packs within classDouglas Gregor2011-01-031-4/+4
| | | | | | template partial specialization arguments. llvm-svn: 122769
* Add an AST representation for non-type template parameterDouglas Gregor2010-12-231-0/+20
| | | | | | | | | | | | | | packs, e.g., template<typename T, unsigned ...Dims> struct multi_array; along with semantic analysis support for finding unexpanded non-type template parameter packs in types, expressions, and so on. Template instantiation involving non-type template parameter packs probably doesn't work yet. That'll come soon. llvm-svn: 122527
* Clean up the printing of template argument packs; previously, we wereDouglas Gregor2010-12-201-1/+1
| | | | | | getting extra "<>" delimiters around template argument packs. llvm-svn: 122280
* Implement basic support for template instantiation of pack expansionsDouglas Gregor2010-12-201-0/+19
| | | | | | | | | | | | | | | | | whose patterns are template arguments. We can now instantiate, e.g., typedef tuple<pair<OuterTypes, InnerTypes>...> type; where OuterTypes and InnerTypes are template type parameter packs. There is a horrible inefficiency in TemplateArgumentLoc::getPackExpansionPattern(), where we need to create copies of TypeLoc data because our interfaces traffic in TypeSourceInfo pointers where they should traffic in TypeLocs instead. I've isolated in efficiency in this one routine; once we refactor our interfaces to traffic in TypeLocs, we can eliminate it. llvm-svn: 122278
* Introduce a new type, PackExpansionType, to capture types that areDouglas Gregor2010-12-201-2/+14
| | | | | | | | | | | | | | | | | | | | pack expansions, e.g. given template<typename... Types> struct tuple; template<typename... Types> struct tuple_of_refs { typedef tuple<Types&...> types; }; the type of the "types" typedef is a PackExpansionType whose pattern is Types&. This commit introduces support for creating pack expansions for template type arguments, as above, but not for any other kind of pack expansion, nor for any form of instantiation. llvm-svn: 122223
* Add tests checking for unexpanded parameter packs in declarations thatDouglas Gregor2010-12-161-1/+20
| | | | | | | occur within statements. Teach Sema::ActOnExceptionDeclarator() to check for unexpanded parameter packs in the exception type. llvm-svn: 121984
* Check for unexpanded parameter packs in non-type template parameter types.Douglas Gregor2010-12-161-0/+3
| | | | llvm-svn: 121964
* Check for unexpanded parameter packs in default arguments.Douglas Gregor2010-12-161-0/+9
| | | | llvm-svn: 121962
* Check for unexpanded parameter packs within variable initializers.Douglas Gregor2010-12-161-0/+7
| | | | llvm-svn: 121938
* Check for unexpanded parameter packs in friend declarations.Douglas Gregor2010-12-161-0/+4
| | | | llvm-svn: 121934
* Check for unexpanded parameter packs in using declarations. As aDouglas Gregor2010-12-161-2/+7
| | | | | | | drive-by, make sure to check for unexpanded parameter packs within the name of a declaration. llvm-svn: 121930
* Check for unexpanded parameter packs in enumeration types and enumerators.Douglas Gregor2010-12-161-0/+4
| | | | llvm-svn: 121928
* Check for unexpanded parameter packs in static assertion expressions.Douglas Gregor2010-12-151-0/+1
| | | | llvm-svn: 121922
* Check for unexpanded parameter packs in various kinds ofDouglas Gregor2010-12-151-0/+15
| | | | | | | | declarations. This is a work in progress, as I go through the C++ declaration grammar to identify where unexpanded parameter packs can occur. llvm-svn: 121912
* Test that all of the relevant types properly compute the "containsDouglas Gregor2010-12-151-3/+89
| | | | | | | unexpanded parameter pack" bit and that the recursive AST visitor can then find those unexpanded parameter packs. llvm-svn: 121899
* Introduce a RecursiveASTVisitor subclass that finds all unexpandedDouglas Gregor2010-12-151-3/+18
| | | | | | | | | | | | | | | | parameter packs within a statement, type, etc. Use this visitor to provide improved diagnostics for the presence of unexpanded parameter packs in a full expression, base type, declaration type, etc., by highlighting the unexpanded parameter packs and providing their names, e.g., test/CXX/temp/temp.decls/temp.variadic/p5.cpp:28:85: error: declaration type contains unexpanded parameter packs 'VeryInnerTypes', 'OuterTypes', ... ...VeryInnerTypes, OuterTypes>, pair<InnerTypes, OuterTypes> > types; ~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ^ llvm-svn: 121883
* Variadic templates: extend the Expr class with a bit that specifiesDouglas Gregor2010-12-151-0/+5
| | | | | | | | | | | | | | | | | | whether the expression contains an unexpanded parameter pack, in the same vein as the changes to the Type hierarchy. Compute this bit within all of the Expr subclasses. This change required a bunch of reshuffling of dependency calculations, mainly to consolidate them inside the constructors and to fuse multiple loops that iterate over arguments to determine type dependence, value dependence, and (now) containment of unexpanded parameter packs. Again, testing is painfully sparse, because all of the diagnostics will change and it is more important to test the to-be-written visitor that collects unexpanded parameter packs. llvm-svn: 121831
* Variadic templates: extend Type, NestedNameSpecifier, TemplateName,Douglas Gregor2010-12-131-0/+11
and TemplateArgument with an operation that determines whether there are any unexpanded parameter packs within that construct. Use this information to diagnose the appearance of the names of parameter packs that have not been expanded (C++ [temp.variadic]p5). Since this property is checked often (every declaration, ever expression statement, etc.), we extend Type and Expr with a bit storing the result of this computation, rather than walking the AST each time to determine whether any unexpanded parameter packs occur. This commit is deficient in several ways, which will be remedied with future commits: - Expr has a bit to store the presence of an unexpanded parameter pack, but it is never set. - The error messages don't point out where the unexpanded parameter packs were named in the type/expression, but they should. - We don't check for unexpanded parameter packs in all of the places where we should. - Testing is sparse, pending the resolution of the above three issues. llvm-svn: 121724
OpenPOWER on IntegriCloud