History log of /external/clang/lib/Sema/SemaTemplateVariadic.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
2d67097ad41f4c2fe82ebce3f587e06498f1bd71 17-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor all diagnosing of TypoCorrections through a common function, in
preparation for teaching this function how to diagnose a correction that
includes importing a module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
850cf510b8e310a99344c29731f0b68e096a8658 20-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Fix one place I missed that was memcpy'ing TypeLocs in a way that messes
up alignment.

Fixes utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp from the
libc++ testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
44ee0a710c59d8e6793189f903bae21c16814324 07-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Re-commit r183466 with a fix to make the TypeLoc casting machinery work
correctly in the presence of qualified types.

(I had to change the unittest because it was trying to cast a
QualifiedTypeLoc to TemplateSpecializationTypeLoc.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
20387efff0870da2c8b30bb62ae661239a903021 07-Jun-2013 Manuel Klimek <klimek@google.com> Reverts r183466: "Perform dynamic alignment computations..."

This introduces bugs in TemplateSpecializationTypeLoc's angle bracket
locations.

Regression test follows in a subsequent commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
86875b11db3536858116effd80cbb06b6810303d 07-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Perform dynamic alignment computations so that the data in TypeLocs is
correctly aligned. Not performing such computations led to misaligned loads,
which crash on some platforms and are generally bad on other platforms.

The implementation of TypeLocBuilder::pushImpl is rather messy; code using
TypeLocBuilder accidentally assumes that partial TypeLocs are
laid out like a complete TypeLoc. As a followup, I intend to work on
fixing the TypeLocBuilder API to avoid exposing partial TypeLocs; this should
substantially simplify the implemementation.

Fixes PR16144.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
0d8e9646bc000bab521ce52ed294209a92298cef 16-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> First pass of semantic analysis for init-captures: check the initializer, build
a FieldDecl from it, and propagate both into the closure type and the
LambdaExpr.

You can't do much useful with them yet -- you can't use them within the body
of the lambda, because we don't have a representation for "the this of the
lambda, not the this of the enclosing context". We also don't have support or a
representation for a nested capture of an init-capture yet, which was intended
to work despite not being allowed by the current standard wording.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
a2c3646c35dd09d21b74826240aa916545b1873f 26-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++1y decltype(auto).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
66874fb18afbffb8b2ca05576851a64534be3352 21-Feb-2013 David Blaikie <dblaikie@gmail.com> Use None rather than Optional<T>() where possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
dc84cd5efdd3430efb22546b4ac656aa0540b210 20-Feb-2013 David Blaikie <dblaikie@gmail.com> Include llvm::Optional in clang/Basic/LLVM.h

Post-commit CR feedback from Jordan Rose regarding r175594.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
39e6ab4be93d9c5e729a578ddd9d415cd2d49872 18-Feb-2013 David Blaikie <dblaikie@gmail.com> Replace TypeLoc llvm::cast support to be well-defined.

The TypeLoc hierarchy used the llvm::cast machinery to perform undefined
behavior by casting pointers/references to TypeLoc objects to derived types
and then using the derived copy constructors (or even returning pointers to
derived types that actually point to the original TypeLoc object).

Some context is in this thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html
Though it's spread over a few months which can be hard to read in the mail
archive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
21f18c4fda167dc5f72feddbd6a7ac1b63200a0d 07-Feb-2013 Guy Benyei <guy.benyei@intel.com> Add OpenCL samplers as Clang builtin types and check sampler related restrictions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
b7e5eec2f57bd82c6ddb762ca3dd7b7d8697e9d5 02-Feb-2013 Nick Lewycky <nicholas@mxc.ca> This patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use.

Also fixes a bug that caused us to not mark the function referenced just
because we didn't want to mark it odr used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
e6b9d802fb7b16d93474c4f1c179ab36202e8a8b 20-Jan-2013 Guy Benyei <guy.benyei@intel.com> Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
b13621d08e20ac7aa550e05896de8a57ee99c1e8 18-Dec-2012 Guy Benyei <guy.benyei@intel.com> Re-commit r170428 changes with Linux style file endings.

Add OpenCL images as clang builtin types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
7f92f2d8d9b7a07900c030183bc13a9ff60057cc 18-Dec-2012 Guy Benyei <guy.benyei@intel.com> Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
736104a7619c53ef92553780273d7357a3cdde81 18-Dec-2012 Guy Benyei <guy.benyei@intel.com> Add OpenCL images as clang builtin types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
6666ed4ed2e2bc13da5ac5d0a4947019137d45be 31-Aug-2012 Joao Matos <ripzonetriton@gmail.com> Improved MSVC __interface support by adding first class support for it, instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
612409ece080e814f79e06772c690d603f45fbd6 25-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR12057: Allow variadic template pack expansions to cross lambda boundaries.
Rather than adding a ContainsUnexpandedParameterPack bit to essentially every
AST node, we tunnel the bit directly up to the surrounding lambda expression
when we reach a context where an unexpanded pack can not normally appear.
Thus any statement or declaration within a lambda can now potentially contain
an unexpanded parameter pack.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
500d729e85028944355a119f9823ac99fa5ddcab 18-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13386: When matching up parameters between a function template declaration
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
5a5a971908a1fd064454db44c42333a3aecf3d5b 04-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> For PR11916: Add support for g++'s __int128 keyword. Unlike __int128_t, this is
a type specifier and can be combined with unsigned. This allows libstdc++4.7 to
be used with clang in c++98 mode.

Several other changes are still required for libstdc++4.7 to work with clang in
c++11 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
f4b88a45902af1802a1cb42ba48b1c474474f228 10-Mar-2012 John McCall <rjmccall@apple.com> Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr to
track whether the referenced declaration comes from an enclosing
local context. I'm amenable to suggestions about the exact meaning
of this bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
ebcb57a8d298862c65043e88b2429591ab3c58d3 06-Mar-2012 Ted Kremenek <kremenek@apple.com> Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,
NSNumber, and boolean literals. This includes both Sema and Codegen support.
Included is also support for new Objective-C container subscripting.

My apologies for the large patch. It was very difficult to break apart.
The patch introduces changes to the driver as well to cause clang to link
in additional runtime support when needed to support the new language features.

Docs are forthcoming to document the implementation and behavior of these features.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
88530d5e138f36ea80a7d70c14f37095b8eba85b 01-Mar-2012 Eli Friedman <eli.friedman@gmail.com> Fix the isReferenced bit on parameters in a couple of edge cases. PR12153.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
4fe5be028b723fedc28bb33be96cde1ab2574ee6 22-Feb-2012 Bill Wendling <isanbard@gmail.com> ArrayRef-icize the function arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
16e46dd0c284296cea819dfbf67942ecef02894d 01-Feb-2012 Kaelyn Uhrain <rikka@google.com> Make the callback object to Sema::CorrectTypo mandatory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
3026348bd4c13a0f83b59839f64065e0fcbea253 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
f8ec8c9935acf77ff929b0aa51428d70c37c232a 14-Jan-2012 Kaelyn Uhrain <rikka@google.com> Convert SemaTemplate*.cpp to pass a callback object to CorrectTypo.

The change to SemaTemplateVariadic.cpp improves the typo correction
results in certain situations, while the change to SemaTemplate.cpp
does not change existing behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
65019acfc46ffb191fac4e781ac0c4b8d0c8434e 25-Oct-2011 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in the name that guards a
Microsoft __if_exists/__if_not_exists statement. Also note that we
weren't traversing DeclarationNameInfo *at all* within the
RecursiveASTVisitor, which would be rather fatal for variadic
templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
aa4a99b4a62615db243f7a5c433169f2fc704420 15-Oct-2011 Anton Korobeynikov <asl@math.spbu.ru> Provide half floating point support as a storage only type.
Lack of half FP was a regression compared to llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
b001de7458d17c17e6d8b8034c7cfcefd3b70c00 07-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.

Thanks to Jeffrey Yasskin for the thorough review!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
a71f9d0a5e1f8cafdd23a17e292de22fdc8e99ff 22-Sep-2011 David Blaikie <dblaikie@gmail.com> ArrayRef-ifying the UnexpandedParameterPacks passed to Sema::CheckParameterPacksForExpansion


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
d8bba9c15230d2b1b3893e272106aa79efc50251 28-Jun-2011 Douglas Gregor <dgregor@apple.com> Add support for C++ namespace-aware typo correction, e.g., correcting

vector<int>

to

std::vector<int>

Patch by Kaelyn Uhrain, with minor tweaks + PCH support from me. Fixes
PR5776/<rdar://problem/8652971>.

Thanks Kaelyn!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
ca63c200346c0ca9e00194ec6e34a5a7b0ed9321 25-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a new type node, UnaryTransformType, designed to represent a
type that turns one type into another. This is used as the basis to
implement __underlying_type properly - with TypeSourceInfo and proper
behavior in the face of templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
db5d44b775c60166074acd184ca9f1981c10c2a7 19-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement __underlying_type for libc++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
b7efff4bae117604f442bb6859c844f90b15f3ff 01-May-2011 Chandler Carruth <chandlerc@gmail.com> Switch the interface name for both TemplateTypeParmType and
SubstTemplateTypeParmType to be 'getIdentifier' instead of 'getName' as
it returns an identifier. This makes them more consistent with the
NamedDecl interface.

Also, switch back to using this interface to acquire the indentifier in
TypePrinter.cpp. I missed this in r130628.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
a5fc472b353b88be3b4981da946fb01f5a5cc0c6 10-Apr-2011 John McCall <rjmccall@apple.com> Fix a bunch of major problems with __unknown_anytype and properly test
for them. The only major missing feature is references.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
a70062ff988eb1fc4a159e463a2a3de5155b7f6a 17-Feb-2011 Chris Lattner <sabre@nondot.org> remove some defensive code: LocalInstantiationScope::getInstantiationOf
and findInstantiationOf can never return null, even on invalid code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
9577abc63f2c7afe5adf6e4e101ae91d29c3b8a6 23-Jan-2011 Ted Kremenek <kremenek@apple.com> Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
8619edd6c5636dcdde75b1151e21029e38592e2f 21-Jan-2011 Douglas Gregor <dgregor@apple.com> Fix a use of uninitialized variables, found by Ted!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
a779d9ca2fdf1247f65de0e6acf2870d8be53ccd 19-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement basic support for the use of variadic templates and blocks
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
67fd1251aad51bb80d050b7fa5e506fef0ec8e02 14-Jan-2011 Douglas Gregor <dgregor@apple.com> Teach PackExpansionExpr to keep track of the number of pack expansions
it will expand to, if known. Propagate this information throughout Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
cded4f649cd4b7ba7d461c25c6482ef52b8d3a2a 14-Jan-2011 Douglas Gregor <dgregor@apple.com> Keep track of the number of expansions to be produced from a type pack
expansion, when it is known due to the substitution of an out
parameter pack. This allows us to properly handle substitution into
pack expansions that involve multiple parameter packs at different
template parameter levels, even when this substitution happens one
level at a time (as with partial specializations of member class
templates and the signatures of member function templates).

Note that the diagnostic we provide when there is an arity mismatch
between an outer parameter pack and an inner parameter pack in this
case isn't as clear as the normal diagnostic for an arity
mismatch. However, this doesn't matter because these cases are very,
very rare and (even then) only typically occur in a SFINAE context.

The other kinds of pack expansions (expression, template, etc.) still
need to support optional tracking of the number of expansions, and we
need the moral equivalent of SubstTemplateTypeParmPackType for
substituted argument packs of template template and non-type template
parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
c3069d618f4661d923cb1b5c4525b082fce73b04 14-Jan-2011 Douglas Gregor <dgregor@apple.com> Start implementing support for substitution into pack expansions that
involve template parameter packs at multiple template levels that
occur within the signatures members of class templates (and partial
specializations thereof). This is a work-in-progress that is deficient
in several ways, notably:
- It only works for template type parameter packs, but we need to
also support non-type template parameter packs and template template
parameter packs.
- It doesn't keep track of the lengths of the substituted argument
packs in the expansion, so it can't properly diagnose length
mismatches.

However, this is a concrete step in the right direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
2fc1bb76e719d0620b4a6e2134413933b21ca6b6 12-Jan-2011 Douglas Gregor <dgregor@apple.com> Teach TreeTransform how to transform a pack expansion type into
another pack expansion type. This can happen when rebuilding types in
the current instantiation.

Fixes <rdar://problem/8848837> (Clang crashing on libc++ <functional>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123316 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
21371ea7cf647f4f0f783faac325925cb8febb1c 11-Jan-2011 Douglas Gregor <dgregor@apple.com> When mapping from a function parameter pack to the set of function
parameters it expanded to, map exactly the number of function
parameters that were expanded rather than just running to the end of
the instantiated parameter list. This finishes the implementation of
the last sentence of C++0x [temp.deduct.call]p1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
d3731198193eee92796ddeb493973b7a598b003e 10-Jan-2011 Douglas Gregor <dgregor@apple.com> Work-in-progress implementation of C++0x [temp.arg.explicit]p9, which
allows an argument pack determines via explicit specification of
function template arguments to be extended by further, deduced
arguments. For example:

template<class ... Types> void f(Types ... values);
void g() {
f<int*, float*>(0, 0, 0); // Types is deduced to the sequence int*, float*, int
}

There are a number of FIXMEs in here that indicate places where we
need to implement + test retained expansions, plus a number of other
places in deduction where we need to correctly cope with the
explicitly-specified arguments when deducing an argument
pack. Furthermore, it appears that the RecursiveASTVisitor needs to be
auditied; it's missing some traversals (especially w.r.t. template
arguments) that cause it not to find unexpanded parameter packs when
it should.

The good news, however, is that the tr1::tuple implementation now
works fully, and the tr1::bind example (both from N2080) is actually
working now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
12c9c00024a01819e3a70ef6d951d32efaeb9312 07-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement substitution of a function parameter pack for its set of
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');
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
1fe85ea697fb5c85acded3ac0ddbc19f89c2e181 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Add Decl::isParameterPack(), which covers both function and template
parameter packs, along with ParmVarDecl::isParameterPack(), which
looks for function parameter packs. Use these routines to fix some
obvious FIXMEs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
ba68eca7582a62e3e2ff4b0eba1b2b73a6b80895 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Add semantic analysis for the creation of and an AST representation
for template template argument pack expansions. This allows fun such
as:

template<template<class> class ...> struct apply_impl { /*...*/ };
template<template<class> class ...Metafunctions> struct apply {
typedef typename apply_impl<Metafunctions...>::type type;
};

However, neither template argument deduction nor template
instantiation is implemented for template template argument packs, so
this functionality isn't useful yet.

I'll probably replace the encoding of template template
argument pack expansions in TemplateArgument so that it's harder to
accidentally forget about the expansion. However, this is a step in
the right general direction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
61c4d28e36cd3f1be392cb77f07436d1fa6b0f9f 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement support for template template parameter packs, e.g.,

template<template<class> class ...Metafunctions>
struct apply_to_each;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
ee8aff06f6a96214731de17b2cb6df407c6c1820 04-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement the sizeof...(pack) expression to compute the length of a
parameter pack.

Note that we're missing proper libclang support for the new
SizeOfPackExpr expression node.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
f90b27ad077c3339b62befc892382845339f9490 03-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement pack expansions whose pattern is a base-specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
7a21fd45d4f04643cbfb5df96a01f84bc6d3dd14 03-Jan-2011 Douglas Gregor <dgregor@apple.com> Properly rebuild pack expansions whose pattern is a non-type template
argument. As part of this, be more careful when determining if there
are any parameter packs that cannot be expanded.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
925910d488051cbd4e38f350c1e9d69c473f09a0 03-Jan-2011 Douglas Gregor <dgregor@apple.com> Diagnose the presence of unexpanded parameter packs within class
template partial specialization arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
be230c36e32142cbdcdbe9c97511d097beeecbab 03-Jan-2011 Douglas Gregor <dgregor@apple.com> Implement support for pack expansions whose pattern is a non-type
template argument (described by an expression, of course). For
example:

template<int...> struct int_tuple { };

template<int ...Values>
struct square {
typedef int_tuple<(Values*Values)...> type;
};

It also lays the foundation for pack expansions in an initializer-list.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
56bc9832bc8f80604bfddc2c93f81537df6930a1 24-Dec-2010 Douglas Gregor <dgregor@apple.com> When instantiating a non-type template parameter pack, be sure to
extract the appropriate argument from the argument pack (based on the
current substitution index, of course). Simple instantiation of pack
expansions involving non-type template parameter packs now works.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
10738d36b150aa65206890c1c845cdba076e4200 24-Dec-2010 Douglas Gregor <dgregor@apple.com> Add an AST representation for non-type template parameter
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
a8bc8c9e9ba5bffebde00340786fe8542469c435 23-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement parsing of function parameter packs and non-type template
parameter packs (C++0x [dcl.fct]p13), including disambiguation between
unnamed function parameter packs and varargs (C++0x [dcl.fct]p14) for
cases like

void f(T...)

where T may or may not contain unexpanded parameter packs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
e02e26293cf8e3bad1059b39cea75c6582896da6 22-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement template argument deduction for pack expansions whose
pattern is a template argument, which involves repeatedly deducing
template arguments using the pattern of the pack expansion, then
bundling the resulting deductions into an argument pack.

We can now handle a variety of simple list-handling metaprograms using
variadic templates. See, e.g., the new "count" metaprogram.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
b99268b3083c882103bd1bd08bdcc9a76a2b4795 21-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement instantiation of pack expansions whose pattern is a type-id
in an exception specification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
a40bc724849f9cdc6a7706bc5d230685c3bdf63c 21-Dec-2010 Douglas Gregor <dgregor@apple.com> Give the RecursiveASTVisitor a configuration function
shouldWalkTypesOfTypeLocs() that determines whether it should walk the
Types within TypeLocs. This walk is redundant, but perhaps required
for some clients. Disabling this redundant walk in the unexpanded
parameter pack finder produces better results, because we get
parameter packs with source location info *unless* such source
location information isn't available.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
8491ffe86c50241b47c6d7ef8cd9ee00f5e675da 20-Dec-2010 Douglas Gregor <dgregor@apple.com> Implement basic support for template instantiation of pack expansions
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
7536dd5e6c99584481b7dab68b7e7d8df9c54054 20-Dec-2010 Douglas Gregor <dgregor@apple.com> Introduce a new type, PackExpansionType, to capture types that are
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
099ffe812664e3a24164710c181c26e646391250 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Tweak a comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
6f52675ec400a0ee89ec6214c4845b8ee274304a 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in default arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
0762bfd268552d260899cb414800eadf3b4741b9 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Fix a regression I caused in r121930. It turns out that
DeclarationNameInfo instances don't always have a non-NULL
TypeSourceInfo?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
56c04588ef3cfa1bbc968fd68de2480a4e66971d 16-Dec-2010 Douglas Gregor <dgregor@apple.com> Check for unexpanded parameter packs in using declarations. As a
drive-by, make sure to check for unexpanded parameter packs within the
name of a declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
cff163e3cc78277496b30fa40070b46abdc290db 15-Dec-2010 Douglas Gregor <dgregor@apple.com> Test that all of the relevant types properly compute the "contains
unexpanded parameter pack" bit and that the recursive AST visitor can
then find those unexpanded parameter packs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
9ef75899bae6dd9a4be1252ae9cadcb619c170ff 15-Dec-2010 Douglas Gregor <dgregor@apple.com> Introduce a RecursiveASTVisitor subclass that finds all unexpanded
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;
~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp
c46333550f5787b6d48ca3043e14ba9594cb632d 15-Dec-2010 Douglas Gregor <dgregor@apple.com> Move the work-in-progress implementation of variadic templates to its own file in Sema. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Sema/SemaTemplateVariadic.cpp