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
emp.decls/temp.fct/temp.func.order/p3-0x.cpp
emp.decls/temp.fct/temp.func.order/p3.cpp
emp.param/p14.cpp
|
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 |
29-May-2014 |
Stephen Hines <srhines@google.com> |
Update Clang for 3.5 rebase (r209713). Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
emp.spec/temp.explicit/p1-emit.cpp
|
651f13cea278ec967336033dd032faef0e9fc2ec |
24-Apr-2014 |
Stephen Hines <srhines@google.com> |
Updated to Clang 3.5a. Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
3.cpp
emp.arg/temp.arg.nontype/p5.cpp
emp.decls/temp.class.spec/p8-1y.cpp
emp.decls/temp.mem/p3.cpp
emp.decls/temp.variadic/fixed-expansion.cpp
emp.decls/temp.variadic/p5.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp
emp.res/temp.local/p3.cpp
emp.spec/cxx1y-variable-template-no-body.cpp
emp.spec/no-body.cpp
emp.spec/temp.expl.spec/p2-0x.cpp
emp.spec/temp.expl.spec/p2.cpp
|
57907e56191adea0fa870c052054eb0fe0c4681f |
28-Nov-2013 |
Bill Wendling <isanbard@gmail.com> |
Merging r195827: ------------------------------------------------------------------------ r195827 | majnemer | 2013-11-27 00:20:38 -0800 (Wed, 27 Nov 2013) | 9 lines Sema: Instantiate local class and their members appropriately We would fail to instantiate them when the surrounding function was instantiated. Instantiate the class and add it's members to the list of pending instantiations, they should be resolved when we are finished with the function's body. This fixes PR9685. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195900 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.inst/p1.cpp
|
ce6426feda94ca716ee7743b71961850740eb08d |
08-Nov-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Issue a diagnostic if we see a templated friend declaration that we do not support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194273 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
099791143ba548bf0a228da0d268b463a3507929 |
26-Oct-2013 |
David Majnemer <david.majnemer@gmail.com> |
Sema: Emit a nicer diagnostic when IndirectFieldDecls show up inappropriately in non-type template arguments git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193462 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1.cpp
|
588a51a471b4cb23613e8183e05d2d193d2ab813 |
22-Oct-2013 |
David Majnemer <david.majnemer@gmail.com> |
Sema: Do not allow template declarations inside local classes Summary: Enforce the rule in C++11 [temp.mem]p2 that local classes cannot have member templates. This fixes PR16947. N.B. C++14 has slightly different wording to afford generic lambdas declared inside of functions. Fun fact: Some formulations of local classes with member templates would cause clang to crash during Itanium mangling, such as the following: void outer_mem() { struct Inner { template <typename = void> struct InnerTemplateClass { static void itc_mem() {} }; }; Inner::InnerTemplateClass<>::itc_mem(); } Reviewers: eli.friedman, rsmith, doug.gregor, faisalv Reviewed By: doug.gregor CC: cfe-commits, ygao Differential Revision: http://llvm-reviews.chandlerc.com/D1866 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193144 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.mem/p2.cpp
|
b5c7768a74936d4e2c7a484570a638cb74702d8b |
19-Oct-2013 |
Kaelyn Uhrain <rikka@google.com> |
Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes. Now that CorrectTypo knows how to correctly search classes for typo correction candidates, there is no good reason to only replace an existing CXXScopeSpecifier if it refers to a namespace. While the actual enablement was a matter of changing a single comparison, the fallout from enabling the functionality required a lot more code changes (including my two previous commits). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193020 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.enum/p1.cpp
|
49ef481bc1b0b0f757ba6ac1ad6d0425390e7654 |
16-Oct-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR17592: Ensure we diagnose shadowing a template parameter with a local extern declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192846 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.local/p6.cpp
|
0302214d4a10ed328b1ec2de932f112881e9c217 |
24-Sep-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Hopefully unbreak bots which are seeing an assert in this test. Temporary, real fix to come once I've tracked down the problem (which is pre-existing and not related to the change which introduced this test). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191279 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/p8-1y.cpp
|
ecbce69e354c77bf2d359111bad0c77c516e16f0 |
24-Sep-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Implement restriction that a partial specialization must actually specialize something, for variable templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191278 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/p8-1y.cpp
|
8e6557e57e2b88fd3de8a87e53e30c774497f51d |
18-Sep-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Fix accepts-invalid if a variable template explicit instantiation is missing an argument list, but could be instantiated with argument list of <>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190913 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/cxx1y-variable-template-no-body.cpp
|
66118c215183dec714cbbdec8060497675cebcac |
11-Sep-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR17075: When performing partial ordering of a member function against a non-member function, the number of arguments in the two candidate calls will be different (the non-member call will have one extra argument). We used to get confused by this, and fail to compare the last argument when testing whether the member is better, resulting in us always thinking it is, even if the non-member is more specialized in the last argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190470 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.fct/temp.func.order/p3-0x.cpp
|
3bf48ca9c9f924073cab503799891f539d041d12 |
04-Sep-2013 |
Rafael Espindola <rafael.espindola@gmail.com> |
Disable llvm optimizations, but keep -O1 to test available_externally. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189919 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p9-linkage.cpp
|
4a91989b2dc901a4998fa5443aeba0276a8cfaa6 |
14-Aug-2013 |
Larisse Voufo <lvoufo@google.com> |
Bug fix: disallow a variable template to be redeclared as a non-templated variable git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188350 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/cxx1y-variable-template-no-body.cpp
emp.spec/temp.expl.spec/examples.cpp
|
ef4579cda09b73e3d4d98af48201da25adc29326 |
06-Aug-2013 |
Larisse Voufo <lvoufo@google.com> |
Started implementing variable templates. Top level declarations should be fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187762 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.static/p1.cpp
emp.spec/cxx1y-variable-template-no-body.cpp
emp.spec/temp.expl.spec/examples.cpp
|
3cb443636fb3ca457994d91527a22c5b159e5169 |
05-Aug-2013 |
Serge Pavlov <sepavloff@gmail.com> |
Regression test for PR12699 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187734 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/sizeofpack.cpp
|
22050f25e34ba0cd21ee2dc3d765951c48e27cde |
18-Jul-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Reinstate r186040, with additional fixes and more test coverage (reverted in r186331). Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186546 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
52c2575fc77a51f36129be89d1a0a90e31617a57 |
15-Jul-2013 |
Chandler Carruth <chandlerc@gmail.com> |
Re-revert r86040, which was un-reverted in r186199. This breaks the build of basic patterns with repeated friend declarations. See the added test case in SemaCXX/friend.cpp or the test case reported to the original commit log. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186331 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
dc49d523db70a1c9005b7c09de80b22ccb1ed6a4 |
15-Jul-2013 |
Serge Pavlov <sepavloff@gmail.com> |
Fix to PR12262 - assertion when substituting explicit template arguments does not substitute a sizeof-pack expression. The solution is proposed by Richard Smith. Differential Revision: http://llvm-reviews.chandlerc.com/D869 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186306 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/sizeofpack.cpp
|
226399ce18cdcbb1e83af7c5e644bdabb9d4f2f8 |
13-Jul-2013 |
David Blaikie <dblaikie@gmail.com> |
Correctly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENT Test coverage for non-dependent pack expansions doesn't demonstrate a failure prior to this patch (a follow-up commit improving debug info will cover this commit specifically) but covers a related hole in our test coverage. Reviewed by Richard Smith & Eli Friedman. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186261 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.alias/p3.cpp
|
f9e65a274d4e5c5a45503efc81da43be76503983 |
12-Jul-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Unrevert r186040, reverted in r186185, with fix for PR16597. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186199 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
1afa611e36e0ab23dd3cde4bbe5aa74ceb7d77c5 |
12-Jul-2013 |
Chandler Carruth <chandlerc@gmail.com> |
Revert r186040 to fix PR16597 while Richard investigates what the best fix is. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186185 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
433a13d0cdb1c48b828fe5bfb6a835c58e1e758b |
11-Jul-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186040 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
ba5da6e7774b175a961b8e02c246f5272cf07125 |
26-Jun-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Missing test update from r184884. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184885 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
35178dc09d97bb2e0612813def09833866e3ad82 |
22-Jun-2013 |
David Blaikie <dblaikie@gmail.com> |
DebugInfo: Support (using GNU extensions) for template template parameters and parameter packs git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184644 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p2.cpp
|
4447af930ab888a3a37cadaa2e638f54bbd9c2ea |
21-Jun-2013 |
Larisse Voufo <lvoufo@google.com> |
Extend template instantiation bug fix (r184503) with fixit test git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184577 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/no-body.cpp
|
472e66e9d32e587a028bc676aa63bd7137f3d4d4 |
21-Jun-2013 |
Larisse Voufo <lvoufo@google.com> |
Add basic fixit test to template instantiation bug fix (r184503) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184559 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/no-body.cpp
|
7c64ef05e179d29646030e9d453081844ecc537a |
21-Jun-2013 |
Larisse Voufo <lvoufo@google.com> |
Bug Fix: Template explicit instantiations should not have definitions (FixIts yet to be tested.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184503 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/no-body.cpp
|
8ff7e32f9480bf00d8d8476c650907853d1cc354 |
21-Jun-2013 |
Eli Friedman <eli.friedman@gmail.com> |
Add a couple more tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184501 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
98a75581e155a7dac853a69b0151960f8e2aacbd |
13-Jun-2013 |
Nick Lewycky <nicholas@mxc.ca> |
Include the unexpanded packs in the initializer expression when checking a pack expanded constructor initializer list. Fixes PR16303! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183878 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
a4bb99cd0055ba0e1f3107890e5b6cbe31e6d1cc |
12-Jun-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Move detection of reference members binding to temporaries from building of CXXCtorInitializers to the point where we perform the questionable lifetime extension. This exposed a selection of false negatives in the warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183869 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p5.cpp
|
840462670ba7a6bc26265a2306b35f2f0f01f51c |
21-Apr-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
The 'constexpr implies const' rule for non-static member functions is gone in 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179969 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/multi-level-substitution.cpp
emp.spec/temp.explicit/p1-0x.cpp
|
b16ae8b754fa7ecf80a81e1cb598e17a39d4c167 |
15-Apr-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Add triples to these tests since they're now using TLS, which isn't available on all targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179514 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1-11.cpp
|
38afbc7361d861968232defaeaf8e302af75b5ee |
13-Apr-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Annotate flavor of TLS variable (statically or dynamically initialized) onto the AST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1-11.cpp
|
4b02dff7aebb98d2d60b2ff4d3fc86109213128c |
05-Mar-2013 |
David Blaikie <dblaikie@gmail.com> |
Add quotation marks to template names in diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176474 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
|
29805ca6d278b4d9563adfee67f2478f0fecdcfc |
31-Jan-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Improve 'failed template argument deduction' diagnostic for the case where we have a direct mismatch between some component of the template and some component of the argument. The diagnostic now says what the mismatch was, but doesn't yet say which part of the template doesn't match. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174039 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p1-0x.cpp
|
22eaced5cac3cf0522c953f593419fc6cf184aaf |
18-Jan-2013 |
Douglas Gregor <dgregor@apple.com> |
Once we've collected the template arguments for a partially-substituted parameter pack in a template, forget about the partially-substituted parameter pack: it is now completed. Fixes <rdar://problem/12176336>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172859 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3-0x.cpp
|
459455b9868974e2bb98032f768fe111ff376ada |
17-Jan-2013 |
David Blaikie <dblaikie@gmail.com> |
Add test for PR12938, fixed by Richard Smith in r172691 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172697 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2-0x.cpp
|
419563768ef4929a622d7c2b066856e82901bb91 |
14-Jan-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Refactor to call ActOnFinishFullExpr on every full expression. Teach 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172485 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
emp.decls/temp.variadic/p5.mm
|
21c8fa87a3517d835072193a59a955ec7f6bf408 |
14-Jan-2013 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR12008: defer adding the implicit 'const' to a constexpr member function until we know whether it is static. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172376 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-0x.cpp
|
030a6644f253818b81b4d8a7fc1770c0a3d35474 |
06-Dec-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Fix http://stackoverflow.com/questions/13521163 Don't require that, during template deduction, a template specialization type as a function parameter has at least as many template arguments as one used in a function argument (not even if the argument has been resolved to an exact type); the additional parameters might be provided by default template arguments in the template. We don't need this check, since we now implement [temp.deduct.call]p4 with an additional check after deduction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169475 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp
|
746619a5ace6dcbd0970e904b1ebda838064ec03 |
22-Nov-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Fix regression in r168477. Use canonical decl when looking for base class specified as a qualified name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168479 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.dep/p3.cpp
|
f62c690c55fb920f3ba0a4f6e6e259e2ae7ce297 |
22-Nov-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Fix CXXRecordDecl::forallBases to not look through bases which are dependent and defined within the current instantiation, but which are not part of the current instantiation. Previously, it would look at bases which could be specialized separately from the current template. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168477 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.dep/p3.cpp
|
8e8fb3be5bd78f0564444eca02b404566a5f3b5d |
19-Oct-2012 |
Andy Gibbs <andyg1001@hotmail.co.uk> |
Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166280 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.type/p2-cxx0x.cpp
emp.decls/temp.alias/p1.cpp
emp.decls/temp.class.spec/p9.cpp
emp.decls/temp.class.spec/temp.class.order/p2.cpp
emp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp
emp.decls/temp.class/temp.mem.func/p1-retmem.cpp
emp.decls/temp.class/temp.mem.func/pr5056.cpp
emp.decls/temp.fct/temp.func.order/p3-0x.cpp
emp.decls/temp.fct/temp.func.order/p3.cpp
emp.decls/temp.fct/temp.func.order/p5.cpp
emp.decls/temp.fct/temp.over.link/p4.cpp
emp.decls/temp.friend/p5.cpp
emp.decls/temp.mem/p1.cpp
emp.decls/temp.variadic/deduction.cpp
emp.decls/temp.variadic/example-bind.cpp
emp.decls/temp.variadic/example-function.cpp
emp.decls/temp.variadic/example-tuple.cpp
emp.decls/temp.variadic/injected-class-name.cpp
emp.decls/temp.variadic/partial-ordering.cpp
emp.fct.spec/temp.arg.explicit/p3-0x.cpp
emp.fct.spec/temp.arg.explicit/p9-0x.cpp
emp.fct.spec/temp.deduct/cwg1170.cpp
emp.fct.spec/temp.deduct/sfinae-1.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p2.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p4.cpp
emp.fct.spec/temp.deduct/temp.deduct.conv/p2.cpp
emp.fct.spec/temp.deduct/temp.deduct.conv/p3.cpp
emp.fct.spec/temp.deduct/temp.deduct.partial/p12.cpp
emp.fct.spec/temp.deduct/temp.deduct.partial/p9-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p10-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p2-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p21.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p22.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p8-0x.cpp
emp.names/p2.cpp
emp.names/p4.cpp
emp.param/p10-0x.cpp
emp.param/p10.cpp
emp.param/p13.cpp
emp.param/p2.cpp
emp.param/p5.cpp
emp.param/p8.cpp
emp.res/temp.dep/p3.cpp
emp.res/temp.dep/temp.dep.constexpr/p2-0x.cpp
emp.res/temp.local/p1.cpp
emp.res/temp.local/p7.cpp
emp.res/temp.local/p8.cpp
emp.spec/temp.expl.spec/p1.cpp
emp.spec/temp.expl.spec/p11.cpp
emp.spec/temp.expl.spec/p9.cpp
emp.spec/temp.explicit/p11.cpp
emp.spec/temp.explicit/p3-0x.cpp
emp.spec/temp.explicit/p6.cpp
|
073819806ba2441e2a3e550107f1e756a6ee3ad0 |
26-Sep-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Teach Type::getAs<TemplateSpecializationType> that a TemplateSpecializationType for a type alias template can appear as sugar at any level of desugaring, just like a TypedefType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164655 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p15-cxx0x.cpp
|
407c8470d50be8edaae7ed39a3139adf35af2921 |
20-Sep-2012 |
Eli Friedman <eli.friedman@gmail.com> |
Fix a small FIXME involving template partial ordering and member function templates with an rvalue ref qualifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164267 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.fct/temp.func.order/p3-0x.cpp
|
9cef0064da0fe93cf60cc351d28ddf2e95fba0b3 |
20-Sep-2012 |
Eli Friedman <eli.friedman@gmail.com> |
Fix function template partial ordering rules for static vs. non-static functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164263 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.fct/temp.func.order/p3-0x.cpp
emp.decls/temp.fct/temp.func.order/p3.cpp
|
75379455fc88ca1f021e55ffe1cab3a9c2b2a37a |
13-Sep-2012 |
Douglas Gregor <dgregor@apple.com> |
Promote the warning about extra qualification on a declaration from a warning to an error. C++ bans it, and both GCC and EDG diagnose it as an error. Microsoft allows it, so we still warn in Microsoft mode. Fixes <rdar://problem/11135644>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163831 91177308-0d34-0410-b5e6-96231b3b80d8
3.cpp
|
9a4db032ecd991626d236a502e770126db32bd31 |
12-Sep-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR13811: Add a FunctionParmPackExpr node to handle references to function parameter packs where the reference is not being expanded but the pack has been. Previously, Clang would segfault in such cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163672 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/multi-level-substitution.cpp
|
6964b3f80ce1ba489e7e25e7cd58062699af9b0c |
07-Sep-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR9023: A template template parameter whose template parameter list contains an unexpanded parameter pack is a pack expansion. Thus, as with a non-type template parameter which is a pack expansion, it needs to be expanded early into a fixed list of template parameters. Since the expanded list of template parameters is not itself a parameter pack, it is permitted to appear before the end of the template parameter list, so also remove that restriction (for both template template parameter pack expansions and non-type template parameter pack expansions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163369 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p15-cxx0x.cpp
|
1f2e1a96bec2ba6418ae7f2d2b525a3575203b6a |
10-Aug-2012 |
John McCall <rjmccall@apple.com> |
Check access to friend declarations. There's a number of different things going on here that were problematic: - We were missing the actual access check, or rather, it was suppressed on account of being a redeclaration lookup. - The access check would naturally happen during delay, which isn't appropriate in this case. - We weren't actually emitting dependent diagnostics associated with class templates, which was unfortunate. - Access was being propagated incorrectly for friend method declarations that couldn't be matched at parse-time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161652 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.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
emp.decls/temp.variadic/multi-level-substitution.cpp
|
16d0078d2a4b1024cbeca8e1ebe7c0ed45554f11 |
29-Jun-2012 |
Axel Naumann <Axel.Naumann@cern.ch> |
From Philippe Canal: Update the two function overloads void TemplateSpecializationType::PrintTemplateArgumentList(raw_ostream &OS,.... to behave like std::string TemplateSpecializationType::PrintTemplateArgumentList(const TemplateArgument *Args,... hence making sure that clang consistently adds a space between two '>' at the end of nested template arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159412 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.template/p3-0x.cpp
|
c86c40b912e53fb11ff8f745ed616035b8b7259c |
06-Jun-2012 |
Douglas Gregor <dgregor@apple.com> |
Whenever we have a BalancedDelimiterTracker, we have a 'nested' scope where '>' is going to behave as an operator (and not as a '>' closing a template argument list). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158111 91177308-0d34-0410-b5e6-96231b3b80d8
emp.names/p3-0x.cpp
|
8d3607bf22a6a70acce3722a758f02d4ea84fc3a |
06-Jun-2012 |
Kaelyn Uhrain <rikka@google.com> |
Allow CorrectTypo to add/modify nested name qualifiers to typos that are otherwise too short to try to correct. The TODOs added to two of the tests are for existing deficiencies in the typo correction code that could be exposed by using longer identifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158109 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p3.cpp
|
be0ee875d8a91c031a085cbbd73ad9e8dc1aa8ff |
15-May-2012 |
David Blaikie <dblaikie@gmail.com> |
Improve some of the conversion warnings to fire on conversion to bool. Moves the bool bail-out down a little in SemaChecking - so now -Wnull-conversion and -Wliteral-conversion can fire when the target type is bool. Also improve the wording/details in the -Wliteral-conversion warning to match the -Wconstant-conversion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156826 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/p5.cpp
|
060ddb0173ba91cd400f073ed0bd1f9b9c3a4d50 |
09-May-2012 |
Nuno Lopes <nunoplopes@sapo.pt> |
hopefully fix a bunch of ARM buildbot failures git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156513 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p14.cpp
emp.spec/temp.explicit/p9-linkage.cpp
|
13489673b84fafaaf49cf5ae4e3bb9a945524dcb |
07-May-2012 |
John McCall <rjmccall@apple.com> |
Change how we suppress access control in explicit instantiations so that we actually accumulate all the delayed diagnostics. Do this so that we can restore those diagnostics to good standing if it turns out that we were wrong to suppress, e.g. if the tag specifier is actually an elaborated type specifier and not a declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156291 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p12.cpp
|
7ad5c996e9519ed4e9afd1f0166be1cd2be8415a |
05-May-2012 |
Argyrios Kyrtzidis <akyrtzi@gmail.com> |
Use raw_ostream in TypePrinter and eliminate uses of temporary std::strings. Part of rdar://10796159 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156228 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.template/p3-0x.cpp
|
74e2fc332e07c76d4e69ccbd0e9e47a0bafd3908 |
16-Apr-2012 |
Douglas Gregor <dgregor@apple.com> |
Implement the last part of C++ [class.mem]p2, delaying the parsing of 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154844 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
a1c4f7c833093f87d5187c4449a3d4534cfa40a4 |
13-Apr-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR12500: Improve the wording of the diagnostic for a redefinition of a name in the wrong namespace scope. Patch by Jonathan Sauer! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154656 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2-0x.cpp
emp.spec/temp.expl.spec/p2.cpp
|
50fadd19497f5fa6d8737786ba74af8354d28349 |
10-Apr-2012 |
Douglas Gregor <dgregor@apple.com> |
Improve diagnostics in C++11 when a non-type template argument for a non-type template parameter of pointer type is not a constant expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154424 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1-11.cpp
|
42963612a4187b55685b7f75489c11abd3fa100e |
10-Apr-2012 |
Douglas Gregor <dgregor@apple.com> |
Rework implementation of null non-type template arguments based on Richard's feedback, to properly catch non-constant expressions and type mismatches. Finishes <rdar://problem/11193097>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154407 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1-11.cpp
|
d2008e2c80d6c9282044ec873a937a17a0f33579 |
07-Apr-2012 |
Douglas Gregor <dgregor@apple.com> |
Implement support for null non-type template arguments for non-type template parameters of pointer, pointer-to-member, or nullptr_t type in C++11. Fixes PR9700 / <rdar://problem/11193097>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154219 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1-11.cpp
|
e31b8fb25b458f00e31dcd657c0840e5238e0f05 |
05-Apr-2012 |
David Blaikie <dblaikie@gmail.com> |
Enable warn_impcast_literal_float_to_integer by default. This diagnostic seems to be production ready, it's just an oversight that it wasn't turned on by default. The test changes are a bit of a mixed bag. Some tests that seemed like they clearly didn't need to use this behavior have been modified not to use it. Others that I couldn't be sure about, I added the necessary expected-warnings to. It's possible the diagnostic message could be improved to make it clearer that this warning can be suppressed by using a value that won't lose precision when converted to the target type (but can still be a floating point literal, such as "bool b = 1.0;"). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154068 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/p5.cpp
|
397f32712369bfed739fe3cb180604b472b41942 |
04-Apr-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Hardcode a triple to prevent the test failing on targets which don't support __thread. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154058 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1.cpp
|
b4051e7047a0085f0679257386ff183aed3e5162 |
04-Apr-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Implement C++11 [temp.arg.nontype]'s permission to use the address of an object or function with internal linkage as a non-type template argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154053 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1.cpp
|
6960587df0bd1b421c11715807a4d2302a3aae3c |
28-Mar-2012 |
Douglas Gregor <dgregor@apple.com> |
Unify and fix our checking of C++ [dcl.meaning]p1's requirements concerning qualified declarator-ids. We now diagnose extraneous qualification at namespace scope (which we had previously missed) and diagnose these qualification errors for all kinds of declarations; it was rather uneven before. Fixes <rdar://problem/11135644>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153577 91177308-0d34-0410-b5e6-96231b3b80d8
3.cpp
|
1af83c444e5a2f6f50a6e1c15e6ebc618ae18a5f |
23-Mar-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Support for definitions of member enumerations of class templates outside the class template's definition, and for explicit specializations of such enum members. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153304 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.enum/p1.cpp
emp.spec/temp.explicit/p1-0x.cpp
|
f1c66b40213784a1c4612f04c14cafa2b0e89988 |
15-Mar-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Instantiating a class template should not instantiate the definition of any scoped enumeration members. Later uses of an enumeration temploid as a nested name specifier should cause its instantiation. Plus some groundwork for explicit specialization of member enumerations of class templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152750 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p8.cpp
emp.spec/temp.inst/p1.cpp
|
e37f484ab9a65ce4e5f90adcfa20add4215e0783 |
13-Mar-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Implement [temp.param]p5: the top-level cv-qualifiers on a non-type template parameter's declaration are ignored when determining the parameter's type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152619 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p5.cpp
|
7c5d28b6342229fb648aea59dc063f67ff16bc81 |
13-Mar-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR11850 + duplicates: don't assume that a function parameter pack expansion is at the end of the parameter list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152618 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.cpp
|
860d9b780b54f56cd27e16620196d213385d31f7 |
12-Mar-2012 |
Douglas Gregor <dgregor@apple.com> |
C++11 [temp.deduct.call]p6 tweak: when given a set of overlaoded functions that includes an explicit template argument list, perform an inner deduction against each of the function templates in that list and, if successful, use the result of that deduction for the outer template argument deduction. Fixes PR11713. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152575 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp
|
fc55a8290a3e81111c0a373e1a04b09dd7da0b98 |
11-Mar-2012 |
Douglas Gregor <dgregor@apple.com> |
When template argument deduction is ignoring qualifiers, perform deep structural comparison of non-dependent types. Otherwise, we end up rejecting cases where the non-dependent types don't match due to qualifiers in, e.g., a pointee type. Fixes PR12132. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152529 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p4.cpp
|
e9ee382c32a83e9807a2fe4cfd52b5a11169a4b8 |
22-Feb-2012 |
Eli Friedman <eli.friedman@gmail.com> |
Improve diagnostics a bit for bad member initializers, and fix an obscure bug involving packs. Fixes PR12049. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151130 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.cpp
|
5b9cc5df25c2198f270dd1d5c438fdce70d4051d |
12-Feb-2012 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
Represent C++ direct initializers as ParenListExprs before semantic analysis 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150318 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
b70126a328f89937f46db42f9e3cba1592887c91 |
03-Feb-2012 |
Douglas Gregor <dgregor@apple.com> |
When a pack expansion occurs in the template argument list of an alias 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149697 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/fixed-expansion.cpp
|
8fbbae532e3cb5f45e9e862c60d48c78b0997325 |
03-Feb-2012 |
Douglas Gregor <dgregor@apple.com> |
Implement support for a pack expansion into a fixed-length 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149685 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/fixed-expansion.cpp
|
d1d512a9cd1923566a52e57b7e1e8ae65392f66b |
09-Jan-2012 |
Nico Weber <nicolasweber@gmx.de> |
Fix "note" of a duplicate explicit instantiation definition following a specialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147798 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/examples.cpp
|
6aeaa60217e1ed11a621409acf1b53df0d14b591 |
05-Jan-2012 |
Eli Friedman <eli.friedman@gmail.com> |
Tweak the fix to PR8977: an empty expression-list represents value initialization, not default initialization. Fixes PR11712. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147620 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.cpp
|
d7c56e1114bfe7d461786903bb720d2c6efc05a1 |
29-Dec-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Change the diagnostics which said 'accepted as an extension' to instead say 'is an extension'. The former is inappropriate and confusing when building with -Werror/-pedantic-errors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147357 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
ff91d240d431afbec18e25909caaf5c17f26e643 |
23-Dec-2011 |
Nico Weber <nicolasweber@gmx.de> |
Fix several issues related to specializations and explicit instantiations. Explicit instantiations following specializations are no-ops and hence have no PointOfInstantiation. That was done correctly in most cases, but for a specialization -> instantiation decl -> instantiation definition chain, the definition didn't realize that it was a no-op. Fix that. Also, when printing diagnostics for these no-ops, get the diag location from the decl name location. Add many test cases, one of them not yet passing (but it failed the same way before this change). Fixes http://llvm.org/pr11558 and more. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147225 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/examples.cpp
|
c7feca0392f7a55e1efa56fd1579881cd59d03d3 |
20-Dec-2011 |
Nico Weber <nicolasweber@gmx.de> |
Fix a crash on invalid, http://llvm.org/pr11599 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146988 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p3.cpp
|
fc038e9ef8ed262724f42597ca5c844de97b1202 |
17-Dec-2011 |
Eli Friedman <eli.friedman@gmail.com> |
Remove a non-gcc-compatible extension that would apply attributes on declarations without a declarator to structs. Add a warning for ignored attributes. Patch by Michael Han. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146796 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
aa9aa3bfcd843caf2612726aa9115b30e7006348 |
08-Nov-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Some tests missed from r144056. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144060 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.dep/temp.dep.constexpr/p2-0x.cpp
emp.res/temp.dep/temp.dep.constexpr/p2.cpp
|
c2c11446caaee2d5a787cc8d0310330c6364210d |
25-Oct-2011 |
Douglas Gregor <dgregor@apple.com> |
Make the -Wc++11-compat warnings ignored by default, so we don't break valid C++98/03 code. However, add these warnings to -Wall, for those who obviously already like clean code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142903 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p2.cpp
emp.spec/temp.explicit/p3.cpp
emp.spec/temp.explicit/p5.cpp
|
0b64ba926752110cff1344a46b36e29396cc4d25 |
23-Oct-2011 |
Peter Collingbourne <peter@pcc.me.uk> |
Fix grammar for C++11 alignment specifiers, and add a few FIXMEs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142760 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
fef2189421b89dad5582b6dd7561badd4224d974 |
23-Oct-2011 |
Peter Collingbourne <peter@pcc.me.uk> |
Diagnose unexpanded parameter packs in member initialisers (including in-class member initialisers). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142758 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
9324583ad2afd09db8c9967cd05c4fa44bac9555 |
20-Oct-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
'extern template' is a C++11 feature. Add an Extension for C++98 (this matches gcc's behaviour), and a -Wc++98-compat-pedantic warning for C++11. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142597 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p4.cpp
|
1368e58ae0eb3d92df9fa5538349b6adf6448d15 |
19-Oct-2011 |
David Blaikie <dblaikie@gmail.com> |
Fix pr9789, assert-on-invalid while instantiating an (invalid) class template with a non-final parameter pack. Also improve the warning for non-final parameter packs in this scenario so it only fires once, rather than once for every template parameter after the non-final parameter pack. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142473 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p11-0x.cpp
|
fe6f64846b8714b2951d9ea80fc40a3e020f3920 |
14-Oct-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
[temp.explicit]p1: constexpr cannot be specified in explicit instantiations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141982 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-0x.cpp
|
762bb9d0ad20320b9f97a841dce57ba5e8e48b07 |
14-Oct-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Update all tests other than Driver/std.cpp to use -std=c++11 rather than -std=c++0x. Patch by Ahmed Charles! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141900 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.template/p3-0x.cpp
emp.arg/temp.arg.type/p2-cxx0x.cpp
emp.decls/p3.cpp
emp.decls/temp.alias/p1.cpp
emp.decls/temp.alias/p2.cpp
emp.decls/temp.alias/p3.cpp
emp.decls/temp.class.spec/p8-0x.cpp
emp.decls/temp.class.spec/p9-0x.cpp
emp.decls/temp.fct/temp.func.order/p3-0x.cpp
emp.decls/temp.variadic/deduction.cpp
emp.decls/temp.variadic/example-bind.cpp
emp.decls/temp.variadic/example-function.cpp
emp.decls/temp.variadic/example-tuple.cpp
emp.decls/temp.variadic/ext-blocks.cpp
emp.decls/temp.variadic/injected-class-name.cpp
emp.decls/temp.variadic/metafunctions.cpp
emp.decls/temp.variadic/multi-level-substitution.cpp
emp.decls/temp.variadic/p1.cpp
emp.decls/temp.variadic/p2.cpp
emp.decls/temp.variadic/p4.cpp
emp.decls/temp.variadic/p5.cpp
emp.decls/temp.variadic/parameter-matching.cpp
emp.decls/temp.variadic/partial-ordering.cpp
emp.fct.spec/temp.arg.explicit/p3-0x.cpp
emp.fct.spec/temp.arg.explicit/p9-0x.cpp
emp.fct.spec/temp.deduct/cwg1170.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p1-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.partial/p12.cpp
emp.fct.spec/temp.deduct/temp.deduct.partial/p9-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p10-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p2-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p21.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p22.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p8-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp
emp.param/p10-0x.cpp
emp.param/p11-0x.cpp
emp.param/p15-cxx0x.cpp
emp.param/p9-0x.cpp
emp.res/temp.dep/temp.dep.type/p1.cpp
emp.spec/temp.expl.spec/p2-0x.cpp
emp.spec/temp.explicit/p1-0x.cpp
emp.spec/temp.explicit/p3-0x.cpp
emp.spec/temp.explicit/p9-linkage.cpp
emp.spec/temp.explicit/p9.cpp
emp.type/p1-0x.cpp
|
5fad9b8362c62e230f6603d86ec7d1747e74c737 |
12-Oct-2011 |
Douglas Gregor <dgregor@apple.com> |
When we determine that a function template specialization produced as part of template argument deduction is ill-formed, we mark it as invalid and treat it as a deduction failure. If we happen to find that specialization again, treat it as a deduction failure rather than silently building a call to the declaration. Fixes PR11117, a marvelous bug where deduction failed after creating an invalid specialization, causing overload resolution to pick a different candidate. Then we performed a similar overload resolution later, and happily picked the invalid specialization to call... resulting in a silent link failure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141809 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.mem/p5.cpp
|
b3df1386680b3830d2f4d300d4d7eaba134135fc |
12-Oct-2011 |
Douglas Gregor <dgregor@apple.com> |
Switch diagnostic text from "C++0x" over to "C++11". We'd also like for "C++11" or "c++11" to be used for the warning groups, but without removing the old warning flags. Patches welcome; I've run out of time to work on this today. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141801 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p15.cpp
emp.param/p9.cpp
|
6dbba4fc128e2e2f5b26be996392bd32c0707f13 |
12-Oct-2011 |
John McCall <rjmccall@apple.com> |
Catch placeholder types in DefaultLvalueConversion and DefaultFunctionArrayLvalueConversion. To prevent significant regression for should-this-be-a-call fixits, and to repair some such regression from the introduction of bound member placeholders, make those placeholder checks try to build calls appropriately. Harden the build-a-call logic while we're at it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141738 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp
|
089e8939b7b3e72c32477e39df82f18e6a8f436e |
10-Oct-2011 |
Douglas Gregor <dgregor@apple.com> |
When substituting into a sizeof parameter pack expression in a context where we can't expand (i.e., multi-level substitution), be sure to substitute the pack with its level-reduced pack. Fixes PR10230. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141568 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/multi-level-substitution.cpp
|
d8f5b333f96b4e8018ff3a0d0db62d9e78eb6bdd |
10-Oct-2011 |
Douglas Gregor <dgregor@apple.com> |
Per the note in C++0x [temp.deduct.call]p4, don't attempt template argument deduction against a function parameter that has no deducible template parameters in it. Fixes PR8598. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141517 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p4.cpp
|
33ab0da4b50c0868f0dbbbbb8d018b44acd2bd4d |
09-Oct-2011 |
Douglas Gregor <dgregor@apple.com> |
A friend template specialization is also dependent if any of its template arguments are dependent. Fixes PR10913. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141515 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
85ea7aa961deac1d754f610af8062ae3f8b4e2a5 |
30-Aug-2011 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
Declare and define implicit move constructor and assignment operator. 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138821 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.cpp
|
cf6b0a20c697ba8daf2dff3a4cce2a028b33cb48 |
14-Jul-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR10359: Template declarations which define classes are not permitted to also contain declarators. Previously we would accept code like this: template<typename T> struct S { } f() { return 0; } This case now produces a missing ';' diagnostic, since that seems like a much more likely error than an attempt to declare a function or variable in addition to the class template. Treat this git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135195 91177308-0d34-0410-b5e6-96231b3b80d8
3.cpp
emp.res/temp.local/p3.cpp
|
13b21be065e9feb0759303bd51b8e8653130f0fb |
27-Jun-2011 |
Chandler Carruth <chandlerc@gmail.com> |
Factor out (some of) the checking for invalid forms of pointer arithmetic into a couple of common routines. Use these to make the messages more consistent in the various contexts, especially in terms of consistently diagnosing binary operators with invalid types on both the left- and right-hand side. Also, improve the grammar and wording of the messages some, handling both two pointers and two (different) types. The wording of function pointer arithmetic diagnostics still strikes me as poorly phrased, and I worry this makes them slightly more awkward if more consistent. I'm hoping to fix that with a follow-on patch and test case that will also make them more helpful when a typedef or template type parameter makes the type completely opaque. Suggestions on better wording are very welcome, thanks to Richard Smith for some initial help on that front. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133906 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p7.cpp
|
18e0461ad72dcf6ec93cd3b1df7bf1b5a30b10b7 |
18-Jun-2011 |
Chandler Carruth <chandlerc@gmail.com> |
Accept no-return stripping conversions for pointer type arguments after deducing template parameter types. Recently Clang began enforcing the more strict checking that the argument type and the deduced function parameter type (after substitution) match, but that only consideres qualification conversions. One problem with this patch is that we check noreturn conversions and qualification conversions independently. If a valid conversion would require *both*, perhaps interleaved with each other, it will be rejected. If this actually occurs (I'm not yet sure it does) and is in fact a problem (I'm not yet sure it is), there is a FIXME to implement more intelligent conversion checking. However, this step at least allows Clang to resume accepting valid code we're seeing in the wild. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133327 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
dbfb371e297794e827ad2e5b33b45fafbfc46b29 |
16-Jun-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement the consistency checking for C++ [temp.deduct.call]p3, which checks that the deduced argument type for a function call matches the actual argument type provided. The only place we've found where the consistency checking should actually cause template argument deduction failure is due to qualifier differences that don't fall into the realm of qualification conversions (which are *not* checked when we initially perform deduction). However, we're performing the full checking as specified in the standard to ensure that no other cases exist. Fixes PR9233 / <rdar://problem/9039590>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133163 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
5b01b8319012c6b568de6dfff935c1b16184952f |
07-Jun-2011 |
Douglas Gregor <dgregor@apple.com> |
Downgrade the warning about the use of typedefs for class template specializations within an explicit instantiation to default to off (enabled by -pedantic). Nobody else seem to implement C++ [temp.explicit]p3. Fixes PR10093. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132704 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p2.cpp
|
89b9f10cca9e2812b3e7943d3150fe6c9028bbe4 |
06-Jun-2011 |
Douglas Gregor <dgregor@apple.com> |
Diagnose the condition in C++ [temp.expl.spec]p16 that prohibits specializing a member of an unspecialized template, and recover from such errors without crashing. Fixes PR10024 / <rdar://problem/9509761>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132677 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p16.cpp
|
8735b294a257a07ca158c28094d7324f0adf889a |
03-Jun-2011 |
Douglas Gregor <dgregor@apple.com> |
When checking the instantiation of a default template argument against the template parameter, perform the checking as a "specified" template argument rather than a "deduced" template argument; the latter implies stricter type checking that is not permitted for default template arguments. Also, cleanup our handling of substitution of explicit template arguments for a function template. We were actually performing some substitution of default arguments at this point! Fixes PR10069. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132529 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p9-0x.cpp
|
95ea45072a46ba3c85fc588aed15509a1a0900ed |
02-Jun-2011 |
Douglas Gregor <dgregor@apple.com> |
Fix an incorrect warning about explicit template specializations for nested types, from Michael Han! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132431 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/examples.cpp
|
fc92137eee708b632c00a9b0934ff87aeae234a5 |
20-May-2011 |
Douglas Gregor <dgregor@apple.com> |
Diagnose unexpanded parameter packs in return statements. This manifested in a crash with blocks in PR9953, but it was a ticking time bomb for normal functions, too. Fixes PR9953. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131731 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/ext-blocks.cpp
|
714c992099b3b9442759f29038bb3f2c5a59a23d |
15-May-2011 |
Douglas Gregor <dgregor@apple.com> |
When checking a set of template parameter lists against a nested-name-specifier, re-evaluate the nested-name-specifier as if we were entering that context (which we did!), so that we'll resolve a template-id to a particular class template partial specialization. Fixes PR9913. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131383 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/examples.cpp
|
7822ee3ef9f0d5cfd289258614ac31be70097449 |
12-May-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement CWG1170, which makes access-control errors into template argument deduction failures. Only implemented in C++0x, since this is a significant change in behavior from C++98/03. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131209 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/cwg1170.cpp
|
175c5bb2b09217df71319cb3d58b3c511fd04138 |
12-May-2011 |
Douglas Gregor <dgregor@apple.com> |
When checking for the necessary 'template<>' headers based on the nested of an out-of-line declaration, only require a 'template<>' header for each enclosing class template that hasn't been previously specialized; previously, we were requiring 'template<>' for enclosing class templates and members of class templates that hadn't been previously specialized. Fixes <rdar://problem/9422013>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131207 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/examples.cpp
emp.spec/temp.expl.spec/p15.cpp
emp.spec/temp.expl.spec/p5-example.cpp
|
c840649ed5acccf68e1bc5a9d22f2ea017074586 |
10-May-2011 |
Douglas Gregor <dgregor@apple.com> |
Reimplement Sema::MatchTemplateParametersToScopeSpecifier() based on the semantic context referenced by the nested-name-specifier rather than the syntactic form of the nested-name-specifier. The previous incarnation was based on my complete misunderstanding of C++ [temp.expl.spec]. The latest C++0x working draft clarifies the requirements here, and this rewrite is intended to follow that. Along the way, improve source location information in the diagnostics. For example, if we report that a specific type needs or doesn't need a 'template<>' header, we dig out that type in the nested-name-specifier and highlight its range. Fixes: PR5907, PR9421, PR8277, PR8708, PR9482, PR9668, PR9877, and <rdar://problem/9135379>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131138 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/examples.cpp
emp.spec/temp.expl.spec/p17.cpp
|
536e9c1f103f3e59ed47e35090819eb93596c35b |
06-May-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Slight tweak to alias template error handling: don't guess that a template-id in an alias declaration was meant to be a specialization. Use a generic, but more accurate, diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130961 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/p3.cpp
|
3e4c6c4c79a03f5cb0c4671d7c282d623c6dc35e |
05-May-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Implement support for C++0x alias templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130953 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/p3.cpp
emp.decls/temp.alias/p1.cpp
emp.decls/temp.alias/p2.cpp
emp.decls/temp.alias/p3.cpp
emp.param/p10-0x.cpp
emp.param/p11-0x.cpp
emp.res/temp.dep/temp.dep.type/p1.cpp
emp.type/p1-0x.cpp
|
0f4be74ff0273e505d383f89174ef539828424ed |
03-May-2011 |
Chandler Carruth <chandlerc@gmail.com> |
When parsing a template friend declaration we dropped the template parameters on the floor in certain cases: class X { template <typename T> friend typename A<T>::Foo; }; This was parsed as a *non* template friend declaration some how, and received an ExtWarn. Fixing the parser to actually provide the template parameters to the freestanding declaration parse triggers the code which specifically looks for such constructs and hard errors on them. Along the way, this prevents us from trying to instantiate constructs like the above inside of a outer template. This is important as loosing the template parameters means we don't have a well formed declaration and template instantiation will be unable to rebuild the AST. That fixes a crash in the GCC test suite. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130772 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p3.cpp
|
ad762fcdc16b9e4705b12b09d92b8c026212b906 |
15-Apr-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Add support for C++0x's range-based for loops, as specified by the C++11 draft standard (N3291). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129541 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
99ace16bc6962f1fc3dc45bbbdf2eb74e555a8ad |
12-Apr-2011 |
John McCall <rjmccall@apple.com> |
Template static data members can have weak_odr linkage, not just weak linkage. Also, fix a problem where global weak variables with non-trivial initializers were getting guard variables, or at least were checking for them and then crashing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129342 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-emit.cpp
|
eef7ac5837ef3e0682ac0973121fff8edaa46ca4 |
16-Mar-2011 |
Douglas Gregor <dgregor@apple.com> |
Detect attempts to provide a specialization of a function within a dependent scope and produce an error (rather than crashing). Fixes PR8979. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127749 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
db2eae639d3b7ed61ceb56890b73168517ef57f1 |
16-Mar-2011 |
Douglas Gregor <dgregor@apple.com> |
Clean up our handling of template-ids that resolve down to a single overload, so that we actually do the resolution for full expressions and emit more consistent, useful diagnostics. Also fixes an IRGen crasher, where Sema wouldn't diagnose a resolvable bound member function template-id used in a full-expression (<rdar://problem/9108698>). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127747 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp
|
975cc644d5d9dafdb4060aa31c9753d0554e1308 |
10-Mar-2011 |
Daniel Dunbar <daniel@zuster.org> |
Revert r127206 "Detect attempts to provide a specialization of a function within a...", it appears to cause us to reject various valid codes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127373 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
db93fdee6c5a24e86ee5ed8c1d3b597e17d5893b |
08-Mar-2011 |
Douglas Gregor <dgregor@apple.com> |
Detect attempts to provide a specialization of a function within a dependent scope and produce an error (rather than crashing). Fixes PR8979. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127206 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
cc20945c787a56abe418947fc6a2c520bcec66c0 |
07-Mar-2011 |
Douglas Gregor <dgregor@apple.com> |
Support explicit template specialization and instantiation for members of a C++0x inline namespace within enclosing namespaces, as noted in C++0x [namespace.def]p8. Fixes <rdar://problem/9006349>, a libc++ failure where Clang was rejected an explicit specialization of std::swap (since libc++ puts it into an inline, versioned namespace std::__1). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127162 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2-0x.cpp
emp.spec/temp.explicit/p3-0x.cpp
|
018591f524ca4f3a1e657d0d0a66eadf9dbd55f6 |
02-Mar-2011 |
John McCall <rjmccall@apple.com> |
Semantic checking for exception specifications should be triggered by whether C++ exceptions are enabled, not exceptions in general. PR9358. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126820 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.cpp
|
406f98f6a5a7bde5707085af8d66204e7e76af45 |
02-Mar-2011 |
Douglas Gregor <dgregor@apple.com> |
When we're substituting into a parameter-type-list nested inside the pattern of an expansion, and we have a paramameter that is not a parameter pack, don't suppress substitution of parameter packs within this context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126819 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/multi-level-substitution.cpp
|
abea951c34876a5374d0e3678c7989b225c5c895 |
28-Feb-2011 |
Anders Carlsson <andersca@mac.com> |
Add -fcxx-exceptions to all tests that use C++ exceptions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126599 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
e41721e7dfabcc15cb50be9075a4153f1ad648ea |
19-Feb-2011 |
Anders Carlsson <andersca@mac.com> |
Pass -fexceptions to all tests that use try/catch/throw. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126037 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
c6daf0b29d6c48a99cb1ad707973a7e6dfcafd58 |
17-Feb-2011 |
Douglas Gregor <dgregor@apple.com> |
When printing a qualified type, look through a substituted template parameter type to see what's behind it, so that we don't end up printing silly things like "float const *" when "const float *" would make more sense. Also, replace the pile of "isa" tests with a simple switch enumerating all of the cases, making a few more obvious cases use prefix qualifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125729 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.mem/p5.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp
|
461bf2eb82981d00a014409126ef9c3538551a94 |
04-Feb-2011 |
Douglas Gregor <dgregor@apple.com> |
Tweak my fix for PR8748, and update the incorrect PR number in the test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124863 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p9-0x.cpp
|
d89d86fe4acaa4782b0ed8a684bbc1b32cb48b70 |
04-Feb-2011 |
Douglas Gregor <dgregor@apple.com> |
Tighten up the semantics of default template arguments, per C++0x [temp.param]p9 and C++ DR226. Fixes PR8747. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124856 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p9-0x.cpp
|
ee5d21f63714459f39e0be28fec9dbecf0720505 |
04-Feb-2011 |
Douglas Gregor <dgregor@apple.com> |
When a function template's template parameter has a default argument, it's okay for the following template parameters to not have default arguments (since those template parameters can still be deduced). Also, downgrade the error about default template arguments in function templates to an extension warning, since this is a harmless C++0x extension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124855 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p11-0x.cpp
emp.param/p9.cpp
|
fd1a8fd240c8067e286e3881aac2bd8b700517d3 |
27-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
When we run into a template parameter that should have a default argument but doesn't (because previous template parameters had default arguments), clear out all of the default arguments so that we maintain the invariant that a template parameter has a default argument only if subsequence template parameters also have default arguments. Fixes a crash-on-invalid <rdar://problem/8913649>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124345 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p1.cpp
|
e3c7a7ca66c02567543dbb5ec493818e00e8b177 |
26-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Rvalue references for *this: tentative parsing and template argument deduction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124295 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p8-0x.cpp
|
73b3cf6503f72f054288cf474e1a8c8ae56383c2 |
25-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement the rvalue-reference deduction transformation (from T&& -> T) when taking the address of an overloaded function or matching a specialization to a template (C++0x [temp.deduct.type]p10). Fixes PR9044. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124197 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p10-0x.cpp
|
f1602a56f89ac48aa1b5bce42f07ee795e674a6f |
22-Jan-2011 |
Anders Carlsson <andersca@mac.com> |
A member function template cannot be virtual. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124031 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.mem/p3.cpp
|
b939a1987318f802fd25f89e15ae7d2423161cac |
21-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement core issue 1164, which concerns the partial ordering of f(T&) and f(T&&). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123981 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.partial/p9-0x.cpp
|
dd0e023cf8faf95eb8025a02ce6fd19ef7788216 |
21-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
More testing to C++0x [temp.deduct.call]p3 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123967 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp
|
2ad746aeb90e86cea7afaf552a02ae3f3b5ec859 |
21-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement the special template argument deduction rule for T&& in a call (C++0x [temp.deduct.call]p3). As part of this, start improving the reference-binding implementation used in the computation of implicit conversion sequences (for overload resolution) to reflect C++0x semantics. It still needs more work and testing, of course. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123966 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp
|
dfc331e04d4c6a09fb693a15fc5a57d29a198c86 |
20-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Explicitly track the number of call arguments provided when performing overload resolution, so that we only use that number of call arguments for partial ordering. Fixes PR9006, a recent regression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123861 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.partial/p11.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
emp.decls/temp.variadic/ext-blocks.cpp
|
6952f1e4256c5b43aee5e98cea4e9b663bd1d413 |
19-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement support for non-type template parameter packs whose type is 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123845 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/multi-level-substitution.cpp
|
9da95e6eefc4b0ca25e18bdab1b703f5c185deab |
16-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Tweak the partial ordering rules for function templates to prefer a 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123581 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/partial-ordering.cpp
|
1aee05d08b2184acadeb36de300e216390780d6c |
15-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Introduce a new kind of TemplateName that captures a substituted 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123521 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/multi-level-substitution.cpp
|
c7793c73ba8a343de3f2552d984851985a46f159 |
15-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr, 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123506 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/multi-level-substitution.cpp
|
2be29f423acad3bbe39099a78db2805acb5bdf17 |
15-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Teach template template argument pack expansions to keep track of the number of expansions, when we know it, and propagate that information through Sema. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123493 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/multi-level-substitution.cpp
|
6a24bfda084f06a0b252b7befe8cbb17fce7f94e |
14-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Handle substitutions into function parameter packs whose patterns contain multiple parameter packs at different levels. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123488 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/multi-level-substitution.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
emp.decls/temp.variadic/multi-level-substitution.cpp
|
07a77b4b1d1fa95930129541eff8b79558f5d80d |
14-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
When we're instantiating a direct variable initializer that has a pack expansion in it, we may end up instantiating to an empty expression-list. In this case, the variable is uninitialized; tweak the instantiation logic to handle this case. Fixes PR8977. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123449 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.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
emp.decls/temp.variadic/multi-level-substitution.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
emp.decls/temp.variadic/multi-level-substitution.cpp
|
c421f546e63b2f85caa1ca0d94d508f99bb871cb |
13-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Only apply the parameter pack matching of C++0x [temp.arg.template]p3 when we're actually matching a template template argument to a template template parameter. Otherwise, use strict matching. Fixes <rdar://problem/8859985> clang++: variadics and out-of-line definitions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123385 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/parameter-matching.cpp
|
4f1d282d6f32a419e89ddb56342e2313b0c78bb7 |
13-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Allow us to transform pack expansion expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123349 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/injected-class-name.cpp
|
a03478231363c67ea0e1f4bc1bc708e064040e56 |
13-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement C++0x [temp.arg.template]p3, which allows slightly fuzzy matching of variadic template template parameters to template arguments. This paragraph was the subject of ISO C++ committee document N2555: Extending Variadic Template Template Parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123348 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.template/p3-0x.cpp
emp.decls/temp.variadic/metafunctions.cpp
|
ac6c09917eaf32a35d2c7c95856864d877ef1963 |
12-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Add some more partial-ordering tests, including one that changes with the proposed resolution to core isue 692. I'm not certain which way we'll go on this one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123331 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/partial-ordering.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
emp.decls/temp.variadic/injected-class-name.cpp
|
77d6bb9e223496aa5288294f34e7225d1f65dddc |
11-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement partial ordering of class template partial specializations and function templates that contain variadic templates. This involves three small-ish changes: (1) When transforming a pack expansion, if the transformed argument still contains unexpanded parameter packs, build a pack expansion. This can happen during the substitution that occurs into class template partial specialiation template arguments during partial ordering. (2) When performing template argument deduction where the argument is a pack expansion, match against the pattern of that pack expansion. (3) When performing template argument deduction against a non-pack parameter, or a non-expansion template argument, deduction fails if the argument itself is a pack expansion (C++0x [temp.deduct.type]p22). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123279 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/partial-ordering.cpp
emp.fct.spec/temp.deduct/temp.deduct.partial/p12.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p22.cpp
|
4e97586b804f6132d83cb534f16a5b6a7756e819 |
11-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Add another test for [temp.func.order]p5/[temp.deduct.partial]p11, from James Widman. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123245 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp
|
5c7bf42ef16dc767615bed10f3b7b3c1265314e1 |
11-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement C++ [temp.func.order]p5 more directly, by passing down the number of explicit call arguments. This actually fixes an erroneous test for [temp.deduct.partial]p11, where we were considering parameters corresponding to arguments beyond those that were explicitly provided. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123244 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp
|
2e996d929d2593e5131640e774d04fe433ba5f89 |
11-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Add example from C++0x [temp.deduct.type]p21, which already works git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123237 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p21.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
emp.fct.spec/temp.deduct/temp.deduct.call/p1-0x.cpp
|
7d5c0c1273bdc1cb3dff1cb5a62d07b1439e82c7 |
11-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement the last bullet of [temp.deduct.type]p5 and part of the last sentence of [temp.deduct.call]p1, both of which concern the non-deducibility of parameter packs not at the end of a parameter-type-list. The latter isn't fully implemented yet; see the new FIXME. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123210 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p1-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p5-0x.cpp
|
4f3018eceac9cc32966e50ee900d8559efcaea21 |
11-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Make sure that we parse a '>>' that closes two template argument lists appropritely when there are no other template arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123204 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p15-cxx0x.cpp
|
10ffc00e2177f042808f507c8dd50b744ed6f738 |
11-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Add testing for unexpanded parameter packs in all of the C++ expression kinds. This is (indirectly) a test verifying that the recursive AST visitor is visiting the children of these expression nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123198 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
3cae5c9a79bfd2e27eb44c32b13dfacd2ce5c66f |
10-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement more of C++0x [temp.arg.explicit]p9, allowing extension of pack expansions in template argument lists and function parameter lists. The implementation of this paragraph should be complete *except* for cases where we're substituting into one of the unexpanded packs in a pack expansion; that's a general issue I haven't solved yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123188 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p9-0x.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
emp.decls/temp.variadic/example-bind.cpp
emp.decls/temp.variadic/example-tuple.cpp
emp.fct.spec/temp.arg.explicit/p9-0x.cpp
|
e8bbf98ba4a388d89d1b4da9e15aabedf8eb53a6 |
07-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Variadic templates example: a nearly-complete implementation of a TR1 function class template. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123024 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/example-function.cpp
emp.decls/temp.variadic/example-tuple.cpp
|
03414b98caba86771622c35b1fa70d13de0c14ba |
07-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Variadic templates example: a nearly-complete implementation of a TR1 tuple class template. This implementation is boosted directly from the variadic templates proposal. N2080. Note that one section is #ifdef'd out. I'll implement that aspect of template argument deduction next. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123016 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/example-tuple.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
emp.decls/temp.variadic/p2.cpp
emp.decls/temp.variadic/p5.cpp
|
a009b59fc2c550a229b9146aabda8e33fe3a7771 |
07-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Factor out the template transformation of a sequence of function parameters into parameter types, so that substitution of explicitly-specified function template arguments uses the same path. This enables the use of explicitly-specified function template arguments with variadic templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122986 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p9-0x.cpp
|
f5c65ffbd7374b6c8d9f1e361041578640cab320 |
06-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement template argument deduction from a call to a function template whose last parameter is a parameter pack. This allows us to form a call to, e.g., template<typename ...Args1, typename ...Args2> void f(std::pair<Args1, Args2> ...pairs); given zero or more instances of "pair". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122973 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p1-0x.cpp
|
603cfb4da2f7ba08a1c3452c2fbf70585b8e7621 |
06-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Initial implementation of function parameter packs. This implementation allows: 1) Declaration of function parameter packs 2) Instantiation of function parameter packs within function types. 3) Template argument deduction of function parameter packs when matching two function types. We're missing all of the important template-instantiation logic for function template definitions, along with template argument deduction from the argument list of a function call, so don't even think of trying to use these for real yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122926 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/metafunctions.cpp
|
d53e16abd1dcaa2942d5183f48e7f63d0e75b35a |
05-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
When we're converting deduced template arguments to the type of the corresponding template parameter, make sure that prior converted template arguments are available for substitution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122902 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/metafunctions.cpp
|
a7fc901a2e39bfe55bfcff5934b2d9fdf9656491 |
05-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Replace the representation of template template argument pack expansions with something that is easier to use correctly: a new template argment kind, rather than a bit on an existing kind. Update all of the switch statements that deal with template arguments, fixing a few latent bugs in the process. I"m happy with this representation, now. And, oh look! Template instantiation and deduction work for template template argument pack expansions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122896 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/metafunctions.cpp
emp.decls/temp.variadic/p4.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
emp.param/p11-0x.cpp
|
1ed64765624d6f5226dd213e220e038b459972d1 |
05-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement C++0x [temp.param]p11 for non-type and template template parameter packs. Also, the "no template parameters after a template parameter pack" rule only applies to primary class templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122877 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p11-0x.cpp
|
f457c1a0a46d11623c3d4594b57dff7f5a1151da |
05-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement proper parameter pack matching for non-type template parameters and template template parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122875 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/parameter-matching.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
emp.decls/temp.variadic/metafunctions.cpp
emp.decls/temp.variadic/p5.cpp
emp.decls/temp.variadic/parameter-matching.cpp
emp.param/p9-0x.cpp
|
54c53cca105ed595e12fecf04e415c3712bda936 |
05-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Improve our handling of non-type template parameters in partial specializations. We weren't dealing with any of the cases where the type of the non-type template argument differs from the type of the corresponding template parameter in the primary template. We would think that the template parameter in the partial specialization was not deducible (and warn about it, incorrectly), then fail to convert a deduced parameter to the type of the template parameter in the partial specialization (which may involve truncation, among other things). Fixes PR8905. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122851 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/p9.cpp
emp.decls/temp.variadic/deduction.cpp
|
b9a7d6fb53f2b76df2ef832146a1edb4cb01b9f6 |
04-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Improve the checking of deduced template arguments stored within template argument packs when finishing template argument deduction for a function template git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122843 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/deduction.cpp
|
b95cc97b2023d00cd3fbae8455bc9d728eab5e5d |
04-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
When creating the injected-class-name for a class template involving a non-type template parameter pack, make sure to create a pack expansion for the corresponding template argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122799 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/metafunctions.cpp
|
3fb9e4b89f72823f162096086f0f964e6dcf66d6 |
04-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement pack expansion of base initializers, so that we can initialize those lovely mixins that come from pack expansions of base specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122793 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.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
emp.decls/temp.variadic/p4.cpp
|
69e5aed635946419d85a6be8639260e2eb476cb1 |
03-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Add a test that is currently failing git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122780 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/metafunctions.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
emp.decls/temp.variadic/multi-level-substitution.cpp
emp.decls/temp.variadic/p5.cpp
|
bacb9493770ff19cfd8f7bc46a075f14b4d08159 |
03-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Unwrap template argument packs when checking the template arguments of a class template partial specialiation, and look through pack expansions when checking the conditions of C++0x [temp.class.spec]p8. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122774 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/p8-0x.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
emp.decls/temp.variadic/p5.cpp
|
dcaa1ca0b475dfa887e1d061678a1e3501288510 |
03-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Implement support for pack expansions in initializer lists and expression lists. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122764 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.cpp
|
dee196ef31073b40c48d60d9fa626ee1d8daaaee |
03-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Another variadic template metafunction test case: summing values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122752 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/metafunctions.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
emp.decls/temp.variadic/metafunctions.cpp
|
81063a237722ae010bca325021b92436f8c56e05 |
03-Jan-2011 |
Douglas Gregor <dgregor@apple.com> |
Consolidate template metafunction tests for variadic templates into a single file git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122748 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/count.cpp
emp.decls/temp.variadic/metafunctions.cpp
emp.decls/temp.variadic/replace.cpp
|
6e4e17de3df88ead7eaf51b3503a6be1718438c0 |
24-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Fix a thinko in a helper routine for template argument deduction that caused an assertion when dealing with non-type template parameter packs. Add some tests for deduction and instantiation of non-type template parameter packs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122534 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp
|
85374738e40a3b5bf078d05787e8fa96fa63c2d0 |
24-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Non-type template parameter packs cannot have default arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122533 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p9-0x.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
emp.decls/temp.variadic/p4.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
emp.decls/temp.variadic/p5.cpp
|
b9c6631941619fb8c74f1056fbc56270629201c1 |
23-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Reimplement the comparison of a class template partial specialization's template arguments against the primary template's template arguments using the obvious, correct method of checking the injected-class-name type (C++ [temp.class.spec]p9b3). The previous incarnation of this comparison attempted to use its own formulation of the injected-class-name, which is redudant and, with the introduction of variadic templates, became wrong (again). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122508 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/p9-0x.cpp
|
b7d09d627c8576b9bc85f44f05befdd44fedc7ed |
23-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
When forming the injected-class-name of a variadic template, the template argument corresponding to a template parameter pack is an argument pack of a pack expansion of that template parameter pack. Implements C++0x [temp.dep.type]p2 (at least, as much of it as we can). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122498 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/injected-class-name.cpp
|
ea6c96f63a45b4ffdcdf9824a9cf31a32825c0f6 |
23-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Implement the part of C++0x [temp.arg.explicit]p3 that pertains to parameter packs. In particular, a parameter pack not otherwise deduced is deduced to an empty parameter pack. The C++0x wording here is a bit unfortunate; this should really only apply to function templates, and it mentions "trailing" parameter packs, which doesn't really make sense in the context of function templates. Will file a core issue separately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122463 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3-0x.cpp
|
7b976ece336d209977b25b5c28ee09c2d2146e6a |
23-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Implement the rest of C++0x [temp.deduct.type]p9, which specifies that the presence of a pack expansion anywhere except at the end of a template-argument-list causes the entire template-argument-list to be a non-deduced context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122461 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p2-0x.cpp
emp.fct.spec/temp.deduct/temp.deduct.type/p9-0x.cpp
|
0d80abc3b7fb0dca26fb6b272d2c3484f86fb7e7 |
23-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Unify the consistency checking for deduced template arguments into a single routine. Extend that routine to handle consistency checking for template argument packs, so that we can compare the deduced packs for template parameter packs across different pack expansions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122452 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p2-0x.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
emp.decls/temp.variadic/count.cpp
|
0972c867e72171f24052d7b6d307020c065f8a66 |
22-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
When performing template argument deduction where the argument is a dependent template specialization type, the number of template arguments need not match precisely. Rather than checking the number of arguments eagerly (which does not consider argument packs), let the deduction routine for template argument lists cope with too many/too few arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122425 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/replace.cpp
|
20a55e2515ce89ddf9993941f9b5d0f3a6c91b4f |
22-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Implicitly expand argument packs when performing template argument deduction. Unify all of the looping over template arguments for deduction purposes into a single place, where argument pack expansion occurs; this is also the hook for deducing from pack expansions, which itself is not yet implemented. For now, at least we can handle a basic "count" metafunction written with variadics. See the new test for the formulation that works. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122418 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/count.cpp
|
55dc95b69846fde1c41aff7e2f3fcfed5d6fc5ab |
21-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Add test for C++ [temp.friend]p8, which bans partial specializations from being friends git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122335 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p8.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
emp.decls/temp.variadic/p4.cpp
|
a04426c5416f22df1078f6b31c1619de73c40b59 |
21-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Extend the parser to support pack expansions within exception specifications. We can't yet instantiate them, however, since I tripped over PR8835. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122292 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.cpp
|
88f30dee6ca6d99e46d4ce61f691fb3dff4ae7c8 |
20-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Test template instantiation of pack expansions where the parameter pack is in a nested-name-specifier git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122282 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.cpp
|
dace95b13e2ceb0c3ec8de6babd926dc5114e1e5 |
20-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Clean up the printing of template argument packs; previously, we were getting extra "<>" delimiters around template argument packs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122280 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p4.cpp
emp.decls/temp.variadic/p5.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
emp.decls/temp.variadic/p4.cpp
emp.decls/temp.variadic/p5.cpp
|
14be16b93941aa4c4909b596d52a34af70ee1928 |
20-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
When checking a template argument list against a template containing a parameter pack, check the parameter pack against each of the template arguments it corresponds to, then pack the converted arguments into a template argument pack. Allows us to use variadic class templates so long as instantiation isn't required, e.g., template<typename... Types> struct Tuple; Tuple<int, float> *t2; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122251 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p1.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
emp.decls/temp.variadic/p5.cpp
|
a669c534cf414339060868d70d2348fea9ce6c7d |
16-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Add tests checking for unexpanded parameter packs in declarations that occur within statements. Teach Sema::ActOnExceptionDeclarator() to check for unexpanded parameter packs in the exception type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121984 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
781def075d4a486a5b367c6730fe77cb1f721ac1 |
16-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Check for unexpanded parameter packs in non-type template parameter types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121964 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.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
emp.decls/temp.variadic/p5.cpp
|
a31040f16604849b3b1dc36015056c81bae68ad1 |
16-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Check for unexpanded parameter packs within variable initializers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121938 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
6ccab97c17c17f38eb92c7fe02c766508875bd97 |
16-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Check for unexpanded parameter packs in friend declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121934 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.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
emp.decls/temp.variadic/p5.cpp
|
0c9e4799fd78d350a037498b2c797f2b2558791c |
16-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Check for unexpanded parameter packs in enumeration types and enumerators. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121928 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
399ad970a25efcbfa7111e17f48285a70fba2731 |
16-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Check for unexpanded parameter packs in static assertion expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121922 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
e186269a8a41dbff1ebea2c251048892979d1078 |
16-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Check for unexpanded parameter packs in various kinds of declarations. This is a work in progress, as I go through the C++ declaration grammar to identify where unexpanded parameter packs can occur. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121912 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.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
emp.decls/temp.variadic/p5.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
emp.decls/temp.variadic/p5.cpp
|
bebbe0d9b7568ce43a464286bee49429489ef483 |
15-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Variadic templates: extend the Expr class with a bit that specifies 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121831 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
d0937224f383c7cc72c947119380f9713a070c73 |
13-Dec-2010 |
Douglas Gregor <dgregor@apple.com> |
Variadic templates: extend Type, NestedNameSpecifier, TemplateName, 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121724 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/p5.cpp
|
8d706ecf488c4f548c4f8cf0aa08ea82a4d6a5ba |
15-Nov-2010 |
Douglas Gregor <dgregor@apple.com> |
Implement C++0x [temp.func.order]p3 (aka DR532) properly. In particular, we only add the implement object parameter type if only one of the function templates is a non-static member function template. Moreover, since this DR differs from existing practice in C++98/03, this commit implements the existing practice (which ignores the first parameter of the function template that is not the non-static member function template) in C++98/03 mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119145 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.fct/temp.func.order/p3-0x.cpp
emp.decls/temp.fct/temp.func.order/p3.cpp
|
d65587f7a6d38965fa37158d3f57990a7faf3836 |
10-Nov-2010 |
Douglas Gregor <dgregor@apple.com> |
Instantiate class member template partial specialization declarations in the order they occur within the class template, delaying out-of-line member template partial specializations until after the class has been fully instantiated. This fixes a regression introduced by r118454 (itself a fix for PR8001). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118704 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/p6.cpp
|
053105d58552c600a2e56473592212a9bddafcd4 |
02-Nov-2010 |
Douglas Gregor <dgregor@apple.com> |
When performing template argument deduction against a template-id, only keep deduction results for successful deductions, so that they can be compared against each other. Fixes PR8462, from Richard Smith! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117983 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
369ea27b56b89379023366ff1b8ab362b5709e4e |
21-Oct-2010 |
Douglas Gregor <dgregor@apple.com> |
Diagnose the declaration of template template parameters that themselves have no template parameters. This is actually a restriction due to the grammar of template template parameters, but we choose to diagnose it in Sema to provide better recovery. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117032 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p1.cpp
|
4e2cbb28baa0342b51336e55c519cd06308c4df2 |
20-Oct-2010 |
John McCall <rjmccall@apple.com> |
When matching template parameter lists to template-ids in a scope specifier on a friend declaration, skip template-ids which do not depend on the current parameter list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116911 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
c54d688c604d28dcb9ab8f92047837c10c8f9c61 |
19-Oct-2010 |
John McCall <rjmccall@apple.com> |
When instantiating a dependently-scoped friend function declaration, we may need to complete the type before looking into it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116795 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
4eab39f0745fb1949dbb40c4145771b927888242 |
19-Oct-2010 |
John McCall <rjmccall@apple.com> |
Instantiate enclosing template parameter lists when instantiating friends. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116789 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
613ef3d4c144f8c35224daf28a187426d2044aee |
19-Oct-2010 |
John McCall <rjmccall@apple.com> |
Uncomputable contexts are always records but can exist. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116787 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
9a34edb710917798aa30263374f624f13b594605 |
19-Oct-2010 |
John McCall <rjmccall@apple.com> |
Redirect templated friend class decls to a new Sema callback and construct an unsupported friend when there's a friend with a templated scope specifier. Fixes a consistency crash, rdar://problem/8540527 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116786 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
5f3aeb6f8b1e1cc00015407ef6886429f9b7fb78 |
13-Oct-2010 |
Douglas Gregor <dgregor@apple.com> |
Teach the warning about unnamed/local types in template arguments to actually walk the template argument type to find any unnamed/local types within it. Fixes PR6784. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116382 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.type/p2.cpp
|
9b623639378d53a675921ddfa7316034d571881e |
13-Oct-2010 |
Douglas Gregor <dgregor@apple.com> |
Introduce support for emitting diagnostics (warnings + their notes) that are suppressed during template argument deduction. This change queues diagnostics computed during template argument deduction. Then, if the resulting function template specialization or partial specialization is chosen by overload resolution or partial ordering (respectively), we will emit the queued diagnostics at that point. This addresses most of PR6784. However, the check for unnamed/local template arguments (which existed before this change) is still only skin-deep, and needs to be extended to look deeper into types. It must be improved to finish PR6784. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116373 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.type/p2.cpp
|
337ec3d0e8cb24a591ecbecdc0a995a167f6af01 |
13-Oct-2010 |
John McCall <rjmccall@apple.com> |
Handle dependent friends more explicitly and deal with the possibility of templated-scope friends by marking them invalid and white-listing all accesses until such time as we implement them. Fixes a crash, this time without a broken test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116364 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
3273b0cea879c7af345d6bf98502bbf73fc4fde1 |
12-Oct-2010 |
Douglas Gregor <dgregor@apple.com> |
When finalizing a function template specialization following template argument deduction, make sure to check the correctness of deduced template type arguments (which we had previously skipped) along with other kinds of template arguments. This fixes part of PR6784, but we're still swallowing the extension warning about unnamed/local template arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116327 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.type/p2.cpp
|
2cd11fefb62c580651e4269e1488381c2d6d07ad |
12-Oct-2010 |
John McCall <rjmccall@apple.com> |
Progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116287 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp
|
2c5399f99c95b831fa90fd3a3c1d9719c1dd9441 |
13-Sep-2010 |
Abramo Bagnara <abramo.bagnara@gmail.com> |
Parentheses around address non-type template argument is demoted to an extension warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113739 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p5.cpp
|
c6dbc3fa467e2355b678a6b717534928048efcb2 |
12-Sep-2010 |
Douglas Gregor <dgregor@apple.com> |
Diagnose the instantiation of variables (including static data members) with function type. Fixes PR8047. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113723 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.type/p2.cpp
|
a4d5de539bc2f0cd25d6292e84eaa067591ff792 |
12-Sep-2010 |
Douglas Gregor <dgregor@apple.com> |
When diagnosing C++ [temp.expl.spec]p3 in C++98/03 mode, downgrade the error to a warning if we're in a case that would be allowed in C++0x. This "fixes" PR8084 by making Clang accept more code than GCC and (non-strict) EDG do. Also, add the missing test case for the C++0x semantics, which should have been in r113717. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113718 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2-0x.cpp
emp.spec/temp.expl.spec/p2.cpp
|
32212f9d000e6bb631499afce43cd13fc0387413 |
06-Sep-2010 |
Chris Lattner <sabre@nondot.org> |
remove curly quotes, patch by Dimitry Andric! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113156 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p12.cpp
|
58f9e13e87e57236fee4b914eea9be6f92a1c345 |
05-Sep-2010 |
Chris Lattner <sabre@nondot.org> |
make clang print types as "const int *" instead of "int const*", which is should have done from the beginning. As usual, the most fun with this sort of change is updating all the testcases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113090 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p5.cpp
emp.decls/temp.mem/p5.cpp
|
17fb855280be411389361f1c79753e0013c4187c |
03-Sep-2010 |
Chandler Carruth <chandlerc@gmail.com> |
Allow anonymous and local types. The support was already in place for these, but this makes them work even as an extension in C++98. This resolves PR8077. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113011 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.type/p2-cxx0x.cpp
|
7e010a04fef171049291d8cb3047f118566da090 |
31-Aug-2010 |
Douglas Gregor <dgregor@apple.com> |
When instantiating a function type, instantiate the return type before instantiating the parameters. In a perfect world, this wouldn't matter, and compilers are free to instantiate in any order they want. However, every other compiler seems to instantiate the return type first, and some code (in this case, Boost.Polygon) depends on this and SFINAE to avoid instantiating something that shouldn't be instantiated. We could fight this battle, and insist that Clang is allowed to do what it does, but it's not beneficial: it's more predictable to instantiate this way, in source order. When we implement late-specified return types, we'll need to instantiate the return type last when it was late-specified, hence the FIXME. We now compile Boost.Polygon properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112561 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/sfinae-1.cpp
|
75f21af57f3dce1577d6c27bbe7bb45b49ced732 |
30-Aug-2010 |
Douglas Gregor <dgregor@apple.com> |
Perform the function-to-pointer adjustment during template argument deduction where the parameter is a function reference, function pointer, or member function pointer and the argument is an overloaded function. Fixes <rdar://problem/8360106>, a template argument deduction issue found by Boost.Filesystem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112523 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp
|
df48ddf97fb5a1310c99f3ece5255477dc1bbbdb |
30-Aug-2010 |
Douglas Gregor <dgregor@apple.com> |
Add test case from PR6952, which now works (thanks to Gabor). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112477 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
58e390ef491c8fb11ae17445054ee09527b492d3 |
25-Aug-2010 |
Chandler Carruth <chandlerc@gmail.com> |
Support explicit instantiation of function templates and members of class templates when only the declaration is in scope. This requires deferring the instantiation to be lazy, and ensuring the definition is required for that translation unit. We re-use the existing pending instantiation queue, previously only used to track implicit instantiations which were required to be lazy. Fixes PR7979. A subsequent change will rename *PendingImplicitInstantiations to *PendingInstatiations for clarity given its broader role. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112037 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p3.cpp
|
72c4c15e030cabf71cffc899ca779a251bcc72d1 |
20-Aug-2010 |
Douglas Gregor <dgregor@apple.com> |
Revert r111609, which is failing its new test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111611 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
29c695b86199ce917fd59b875683960a1858342a |
20-Aug-2010 |
John McCall <rjmccall@apple.com> |
Detect efforts to declare a template member friend and explicitly ignore them. Avoids a crash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111609 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
1357869bc5983cdfbc986db1f3d18265bb34cb0e |
05-Aug-2010 |
Eli Friedman <eli.friedman@gmail.com> |
Get rid of isObjectType; when C++ says "object type", it generally just means "not a function type", not "not a function type or void". This changes behavior slightly, but generally in a way which accepts more code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110303 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p4.cpp
|
66a8c9a6b1f9bcd78779e5d414f3c9ae3cabdd93 |
15-Jul-2010 |
Douglas Gregor <dgregor@apple.com> |
When determining whether an overload set with explicit template arguments only resolves to a single specialization, make sure to look through using declarations. Fixes PR7641. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108376 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3.cpp
|
44eac33ae12df384f3f002102f919f603bee330f |
13-Jul-2010 |
Douglas Gregor <dgregor@apple.com> |
Reinstate the optimization suppressing available_externally functions at -O0. The only change from the previous patch is that we don't try to generate virtual method thunks for an available_externally function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108230 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p9-linkage.cpp
|
27cc6331e33efac4020058d2fda36c9060ec5afa |
12-Jul-2010 |
Douglas Gregor <dgregor@apple.com> |
Speculatively revert r108156; it appears to be breaking self-host. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108194 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p9-linkage.cpp
|
7ce1f2714ac0f33210bab14650bce2078ebf343e |
12-Jul-2010 |
Douglas Gregor <dgregor@apple.com> |
Do not generate LLVM IR for available_externally function bodies at -O0, since we won't be using the definitions for anything anyway. For lib/System/Path.o when built in Debug+Asserts mode, this leads to a 4% improvement in compile time (and suppresses 440 function bodies). <rdar://problem/7987644> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108156 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p9-linkage.cpp
|
926c4b486a08f698cd3a367fd6f1a3a07604358d |
28-Jun-2010 |
Chandler Carruth <chandlerc@gmail.com> |
Partial fix for PR7267 based on comments by John McCall on an earlier patch. This is more targeted, as it simply provides toggle actions for the parser to turn access checking on and off. We then use these to suppress access checking only while we parse the template-id (included scope specifier) of an explicit instantiation and explicit specialization of a class template. The specialization behavior is an extension, as it seems likely a defect that the standard did not exempt them as it does explicit instantiations. This allows the very common practice of specializing trait classes to work for private, internal types. This doesn't address instantiating or specializing function templates, although those apparently already partially work. The naming and style for the Action layer isn't my favorite, comments and suggestions would be appreciated there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106993 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p11.cpp
|
a2dd828ce66a67bc21c3a553e2d99ca4f182d923 |
16-Jun-2010 |
Douglas Gregor <dgregor@apple.com> |
Downgrade the error when using a typedef in the nested-name-specifier of an explicit instantiation to an ExtWarn, since nobody else seems to diagnose this problem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106109 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p2.cpp
|
a417b87e5d0f0508c7b18824d89d489bb55b7bd1 |
04-Jun-2010 |
Douglas Gregor <dgregor@apple.com> |
When checking for equality of template parameter lists, a template type parameter pack is distinct from a template type parameter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105464 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.variadic/parameter-matching.cpp
|
7b6d25b04cb86bbe6940d87dc73da8fbbebda5bd |
04-Jun-2010 |
Douglas Gregor <dgregor@apple.com> |
Properly disambiguate between an elaborated-type-specifier and a type-parameter within a template parameter list. Found by inspection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105462 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p2.cpp
|
d2235f60e7bbd9e690c05fced371df9da76adc2b |
20-May-2010 |
Douglas Gregor <dgregor@apple.com> |
Reinstate r104117, Chandler Carruth's change that "[provides] a naming class for UnresolvedLookupExprs, even when occuring on template names" along with a fix for an Objective-C++ crasher it introduced. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104277 91177308-0d34-0410-b5e6-96231b3b80d8
emp.names/p2.cpp
|
bf1cbaf1b0ac9d967ff6abf27788cc98f0f5e7da |
19-May-2010 |
Daniel Dunbar <daniel@zuster.org> |
Revert r104117, "Provide a naming class for UnresolvedLookupExprs, even when occuring on..." which breaks some Objective-C code. Working on getting a test case... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104150 91177308-0d34-0410-b5e6-96231b3b80d8
emp.names/p2.cpp
|
c3f984fa13364520f4a2c447d1d213db77db3309 |
19-May-2010 |
Chandler Carruth <chandlerc@gmail.com> |
Provide a naming class for UnresolvedLookupExprs, even when occuring on template names. We were completely missing naming classes for many unqualified lookups, but this didn't trigger code paths that need it. This removes part of an optimization that re-uses the template name lookup done by the parser to determine if explicit template arguments actually form a template-id. Unfortunately the technique for avoiding the duplicate lookup lost needed data such as the class context in which the lookup succeeded. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104117 91177308-0d34-0410-b5e6-96231b3b80d8
emp.names/p2.cpp
|
238058c372cfb7bdaf489f51171eb1380ebfd6a6 |
18-May-2010 |
Douglas Gregor <dgregor@apple.com> |
I hate this commit. Revert much of the implementation of C++98/03 [temp.friend]p5 in r103943 and its follow-ons r103948 and r103952. While our implementation was technically correct, other compilers don't seem to implement this paragraph (which forces the instantiation of friend functions defined in a class template when a class template specialization is instantiated), and doing so broke a bunch of Boost libraries. Since this behavior has changed in C++0x (which instantiates the friend function definitions when they are used), we're going to skip the nowhere-implemented C++98/03 semantics and go straight to the C++0x semantics. This commit is a band-aid to get Boost up and running again. It doesn't really fix PR6952 (which this commit un-fixes), but it does deal with the way Boost.Units abuses this particular paragraph. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104014 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
cfe833be882f600206f1587f157b025b368497d7 |
17-May-2010 |
Douglas Gregor <dgregor@apple.com> |
Diagnose a redefinition error when there are two instantiations of friend functions defined inside a class template. Fixes PR6952, the last Boost.Units failure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103952 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
6cfacfe54c75baa4d67f1fbdf4f80644b662818e |
17-May-2010 |
Douglas Gregor <dgregor@apple.com> |
Determine when the instantiation of a friend function defined inside a class template conflicts with an existing (non-template) definition. This is another part of PR6952. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103948 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
ac7c2c8a9d47df7d652364af3043c41816a18fa4 |
17-May-2010 |
Douglas Gregor <dgregor@apple.com> |
C++98/03 [temp.friend]p4 requires that inline function definitions within class templates be instantiated along with each class template specialization, even if the functions are not used. Do so, as a baby step toward PR6952. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103943 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p4.cpp
|
2166beba8d939d2938c5401af2c8d3687afd5d8c |
11-May-2010 |
Douglas Gregor <dgregor@apple.com> |
The C++98/03 standard is disturbingly silent about out-of-scope explicit instantiations of template. C++0x clarifies the intent (they're ill-formed in some cases; see [temp.explicit] for details). However, one could squint at the C++98/03 standard and conclude they are permitted, so reduce the error to a warning (controlled by -Wc++0x-compat) in C++98/03 mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103482 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p2.cpp
emp.spec/temp.explicit/p5.cpp
|
ec20f46740a59758b12c22108002395bcf5b6f9b |
08-May-2010 |
Douglas Gregor <dgregor@apple.com> |
When printing an overload candidate that failed due to SFINAE, print a specific message that includes the template arguments, e.g., test/SemaTemplate/overload-candidates.cpp:27:20: note: candidate template ignored: substitution failure [with T = int *] typename T::type get_type(const T&); // expected-note{{candidate ... ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103348 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp
|
a18592ec62e898aed7ed71e1f09c314590ce9ec7 |
08-May-2010 |
Douglas Gregor <dgregor@apple.com> |
When template argument deduction fails because the call had too many/too few arguments, use the same diagnostic we use for arity mismatches in non-templates (but note that it's a function template). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103341 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp
|
a933319ebf754396623165f9dc0a29c2a48879f5 |
08-May-2010 |
Douglas Gregor <dgregor@apple.com> |
When printing a non-viable overload candidate that failed due to conflicting deduced template argument values, give a more specific reason along with those values, e.g., test/SemaTemplate/overload-candidates.cpp:4:10: note: candidate template ignored: deduced conflicting types for parameter 'T' ('int' vs. 'long') const T& min(const T&, const T&); ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103339 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp
|
516e6e09821a61e8975c787e189949723249e7c5 |
29-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
When performing partial ordering of class template partial specializations, substitute the deduced template arguments and check the resulting substitution before concluding that template argument deduction succeeds. This marvelous little fix makes a bunch of Boost.Spirit tests start working. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102601 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/temp.class.order/p2.cpp
|
0d6b1640eb4d1a4a0203235cfdfcdaf3335af36d |
23-Apr-2010 |
John McCall <rjmccall@apple.com> |
Recommit my change to how C++ does elaborated type lookups, now with two bugfixes which fix selfhost and (hopefully) the nightly tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102198 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
00b40d3f2fb8b2f9043daf3dd4558bff98346b3c |
23-Apr-2010 |
Daniel Dunbar <daniel@zuster.org> |
Revert "C++ doesn't really use "namespaces" for different kinds of names the same", which seems to break most C++ nightly test apps. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102174 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
d04efc98d08731e31bd73f430803acc5ffa9040a |
23-Apr-2010 |
John McCall <rjmccall@apple.com> |
C++ doesn't really use "namespaces" for different kinds of names the same way that C does. Among other differences, elaborated type specifiers are defined to skip "non-types", which, as you might imagine, does not include typedefs. Rework our use of IDNS masks to capture the semantics of different kinds of declarations better, and remove most current lookup filters. Removing the last remaining filter is more complicated and will happen in a separate patch. Fixes PR 6885 as well some spectrum of unfiled bugs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102164 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
a77eaa9f4562dc611aa121a20ee8f2e2146765ce |
18-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
Make sure that we don't visit redeclarations of nested classes while instantiating class members as part of an explicit instantiation. Addresses a compilation problem in Boost.Serialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101725 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/p5.cpp
|
c0b39640de335809ca7544f802751112619f30cc |
16-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
Audit uses of Sema::LookupSingleName for those lookups that are intended for redeclarations, fixing those that need it. Fixes PR6831. This uncovered an issue where the C++ type-specifier-seq parsing logic would try to perform name lookup on an identifier after it already had a type-specifier, which could also lead to spurious ambiguity errors (as in PR6831, but with a different test case). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101419 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p3.cpp
|
74256f5ea6950c9fd34595aa124eb4740372f15c |
14-Apr-2010 |
John McCall <rjmccall@apple.com> |
Parse friend template ids as types instead of ending up in ActOnClassTemplateSpecialization and being very confused. Fixes PR6514 (for non-templated-scope friends). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101198 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
21c0160959961b3a6ab3308608ee3fde182ecb49 |
14-Apr-2010 |
John McCall <rjmccall@apple.com> |
Fix an embarrasing memory error. I was apparently very tired when I wrote this code the first time. Fixes PR6827. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101184 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
01e56aecb77a96dcd93fa0e901b919f2e441981d |
12-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
Implement C++ [temp.local]p4, which specifies how we eliminate name-lookup ambiguities when there are multiple base classes that are all specializations of the same class template. This is part of a general cleanup for ambiguities in template-name lookup. Fixes PR6717. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101065 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.local/p3.cpp
|
57265e35292897e383d70bbd1d552209fac37b39 |
12-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
Fix a crash-on-invalid involving name lookup of tag names, where we ended up finding a function template that we didn't expect. Recover more gracefully, and fix a similar issue for class templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101040 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.mem/p1.cpp
|
c42b6520b607cda57e850a60143e9f98bf421dbb |
09-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
Only complain about explicit instantiations following explicit specializations when the explicit instantiation was... explicitly written, i.e., not the product of an explicit instantiation of an enclosing class. Fixes this spurious warning when Clang builds LLVM: /Volumes/Data/dgregor/Projects/llvm/lib/CodeGen/MachineDominators.cpp:22:1: warning: explicit instantiation of 'addRoot' that occurs after an explicit specialization will be ignored (C++0x extension) [-pedantic] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100900 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p4.cpp
|
7002f4c03c2d0544f4e8bea8d3a5636519081e35 |
09-Apr-2010 |
John McCall <rjmccall@apple.com> |
Turn access control on by default in -cc1. Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100880 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/temp.class.order/p2.cpp
emp.decls/temp.friend/p1.cpp
emp.spec/temp.inst/p11.cpp
|
6cd3b9fb8a29bb70fff01719bdde238723d67c10 |
09-Apr-2010 |
John McCall <rjmccall@apple.com> |
Instantiate default argument expressions even if their associated parameter type isn't dependent. Fixes rdar://problem/7838962. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100871 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.inst/p11.cpp
|
ea7390c7b384ce607bfc8fc13c01f37cfc3776f0 |
08-Apr-2010 |
John McCall <rjmccall@apple.com> |
Set access properly on instantiated friend class template declarations. Fixes PR6752. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100806 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
9ab14541716928894821cf5d53d6b4c95ffdf3a3 |
08-Apr-2010 |
Jeffrey Yasskin <jyasskin@google.com> |
Make CXXScopeSpec invalid when incomplete, and propagate that into any Declarator that depends on it. This fixes several redundant errors and bad recoveries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100779 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p3.cpp
|
af2094e7cecadf36667deb61a83587ffdd979bd3 |
08-Apr-2010 |
John McCall <rjmccall@apple.com> |
Implement dependent friend function template specializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100753 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
06245bfb3ae40bb24a8bfb17eafeb266a4daf5ca |
07-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
Improve handling of friend types in several ways: - When instantiating a friend type template, perform semantic analysis on the resulting type. - Downgrade the errors concerning friend type declarations that do not refer to classes to ExtWarns in C++98/03. C++0x allows practically any type to be befriended, and ignores the friend declaration if the type is not a class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100635 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p3.cpp
|
b7a09260204f2079e0f998bf7ee52b95122a4c5d |
01-Apr-2010 |
Douglas Gregor <dgregor@apple.com> |
Overhaul checking of non-type template arguments that should refer to an object or function. Our previous checking was too lax, and ended up allowing missing or extraneous address-of operators, among other evils. The new checking provides better diagnostics and adheres more closely to the standard. Fixes PR6563 and PR6749. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100125 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1.cpp
emp.arg/temp.arg.nontype/p5.cpp
emp.res/temp.local/p1.cpp
|
02024a9f0d8e6c898de276193af604c42ee41269 |
28-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
After performing template argument deduction for a function template, check deduced non-type template arguments and template template arguments against the template parameters for which they were deduced, performing conversions as appropriate so that deduced template arguments get the same treatment as explicitly-specified template arguments. This is the bulk of PR6723. Also keep track of whether deduction of a non-type template argument came from an array bound (vs. anywhere else). With this information, we enforce C++ [temp.deduct.type]p17, which requires exact type matches when deduction deduces a non-type template argument from something that is not an array bound. Finally, when in a SFINAE context, translate the "zero sized arrays are an extension" extension diagnostic into a hard error (for better standard conformance), which was a minor part of PR6723. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99734 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.type/p17.cpp
|
b0cb022daec8671406ab25f4b5d5a6d48d823bc4 |
27-Mar-2010 |
John McCall <rjmccall@apple.com> |
Implement method friends in class templates and fix a few related problems. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99708 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
4a0bac96103ba9f1528e91a26c0be457d39cec0f |
26-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Add tests for PR6707. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99613 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/p9.cpp
|
d325daa506338ab86f9dd468b48fd010673f49a6 |
26-Mar-2010 |
John McCall <rjmccall@apple.com> |
Reapply r99596 with a fix: link an instantiated friend function to its pattern if it has a body. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99610 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
a7bc8559b40a78d664d6c7faf4b42ff21184c146 |
26-Mar-2010 |
John McCall <rjmccall@apple.com> |
Apparently that didn't work. Reverting for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99601 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
1a6e03457ebafd6ac523cdcf5d6b6f411ea08772 |
26-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Reinstate change to non-type template arguments of integral type, so that we extend/truncate then correct the sign to convert the non-type template argument to the template parameter's type. Previously, we reported an error when the non-type template argument was out of range; now we just warn. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99600 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/p9.cpp
|
d7e29e114d20da5b83e0cb7bc29ec717a7458cb1 |
26-Mar-2010 |
John McCall <rjmccall@apple.com> |
Properly instantiate and link in friend function templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99596 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
0d4fd8ef35ecd73ce6388cb5a6fdcfb15171f5aa |
26-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Revert attempted fix for integral template arguments. It seems to have broken tramp3d-v4. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99583 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/p9.cpp
|
684d096c204c5eef29c10777bce890400d235d8c |
25-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Warn when the conversion of an integral non-type template argument to the type of its corresponding non-type template parameter changes the value. Previously, we were diagnosing this as an error, which was wrong. We give reasonably nice warnings like: test/SemaTemplate/temp_arg_nontype.cpp:100:10: warning: non-type template argument value '256' truncated to '0' for template parameter of type 'unsigned char' Overflow<256> *overflow3; // expected-warning{{non-type template ... ^~~ test/SemaTemplate/temp_arg_nontype.cpp:96:24: note: template parameter is declared here template<unsigned char C> struct Overflow; ^ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99561 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/p9.cpp
|
9c86b513cb42ea6d9e3f98cb2b7eda39a2eb526b |
25-Mar-2010 |
John McCall <rjmccall@apple.com> |
Handle simple friend-class decls in class templates better by ensuring that we look for shadow friend decls in the appropriate scope before injecting a new declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99552 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
93ba8579c341d5329175f1413cdc3b35a36592d2 |
25-Mar-2010 |
John McCall <rjmccall@apple.com> |
Properly instantiate friend class template declarations and link them into the redeclaration chain. Recommitted from r99477 with a fix: we need to merge in default template arguments from previous declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99496 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
e131c574c7baa28eb0759181478d710a2aa60cb6 |
25-Mar-2010 |
Bob Wilson <bob.wilson@apple.com> |
Revert 99477 since it appears to be breaking the clang-x86_64-darwin10-fnt buildbot. The tramp3d test fails. --- Reverse-merging r99477 into '.': U test/SemaTemplate/friend-template.cpp U test/CXX/temp/temp.decls/temp.friend/p1.cpp U lib/Sema/SemaTemplateInstantiateDecl.cpp U lib/Sema/SemaAccess.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99481 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
a56623b01ed9f28f10416432d147c7a1729d5f1d |
25-Mar-2010 |
John McCall <rjmccall@apple.com> |
Properly instantiate and link in friend-class-template declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99477 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
036ada215d2c53e6a286b42d7cbd2386b0007516 |
24-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Silently drop dependent friend function template specializations, since we have absolutely no way to match them when they are declared nor do we have a way to represent these parsed-but-not-checked friend declarations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99407 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
7ad650f88ecbbe659f10f9f6b34a1f29ea9cf8f9 |
24-Mar-2010 |
John McCall <rjmccall@apple.com> |
Support friend function specializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99389 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
emp.spec/temp.expl.spec/p20.cpp
|
0c01d18094100db92d38daa923c95661512db203 |
24-Mar-2010 |
John McCall <rjmccall@apple.com> |
Implement a framework for the delay of arbitrary diagnostics within templates. So delay access-control diagnostics when (for example) the target of a friend declaration is a specific specialization of a template. I was surprised to find that this was required for an access-controlled selfhost. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99383 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
a742db0032d8f458fe229600d2082981a1fb1481 |
17-Mar-2010 |
John McCall <rjmccall@apple.com> |
Implement non-dependent friend functions and classes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98764 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
dbdf5e7d0b6f1f8d8c496c1a0ada6f706cddf100 |
15-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
During C++ name lookup, use DeclContext::Equals() rather than comparing DeclContext pointers, to avoid having to remember to call getPrimaryContext() everywhere. This is the last part PR6594. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98546 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.local/p8.cpp
|
711be1e89a56cdf679143ad18afaa58ed59f0584 |
15-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Implement C++ [temp.local]p8, which specifies that a template parameter hides a namespace-scope declararion with the same name in an out-of-line definition of a template. The lookup requires a strange interleaving of lexical and semantic scopes (go C++), which I have not yet handled in the typo correction/code completion path. Fixes PR6594. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98544 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.local/p7.cpp
emp.res/temp.local/p8.cpp
emp.res/temp.local/p9.cpp
|
8f51a4f2d00b0abda3cde7f3828fb2e2b9beafb5 |
13-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Give explicit template instantiations weak ODR linkage. Former iterations of this patch gave explicit template instantiation link-once ODR linkage, which permitted the back end to eliminate unused symbols. Weak ODR linkage still requires the symbols to be generated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98441 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-emit.cpp
|
34fd284e0a6ea88b98d6e1183548264bab5b3702 |
13-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Re-revert the explicit template instantiation linkage patch. I am beginning to look incompetent git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98425 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-emit.cpp
|
8721360da5cf3d5dfdc2fc2bf8d53a5f79307995 |
13-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Reinstate patch to turn explicit template instantiations into weak symbols git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98424 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-emit.cpp
|
4ea9006629acb6bf9b2984554517c968a10a6b77 |
12-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Revert the linkage change for explicit template instantiations; something is amiss git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98332 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-emit.cpp
|
e5e0c9deb1b4cfa081152cda548d31368facbc57 |
12-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
Give explicit template instantiations weak linkage (but don't defer them). Fixes PR6578. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98328 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-emit.cpp
|
e97c32f9578861d575ca96bbbae426c76cbc9024 |
03-Mar-2010 |
John McCall <rjmccall@apple.com> |
Suppress implicit member redeclarations arising from explicit instantiation declarations after the member has been explicitly specialized. We already did this after explicit instantiation definitions; not doing it for declarations meant that subsequent definitions would see a previous member declaration with specialization kind "explicit instantiation decl", which would then happily get overridden. Fixes PR 6458. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97605 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p4.cpp
|
21d53e179651657e243587b79234fe6fedfae71c |
02-Mar-2010 |
Douglas Gregor <dgregor@apple.com> |
When we're parsing template names as part of base-specifiers, we are *not* entering the context of the nested-name-specifier. This was causing us to look into an uninstantiated template that we shouldn't look into. Fixes PR6376. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97524 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.mem/p1.cpp
|
a9bff30776888977f580c9cac212fd1583ee963e |
28-Feb-2010 |
Douglas Gregor <dgregor@apple.com> |
Warn about the deprecated string literal -> char* conversion. Fixes PR6428. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97404 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3.cpp
|
9ba6166f4a78722e7df8ffbd64eb788bfdf2764a |
26-Feb-2010 |
John McCall <rjmccall@apple.com> |
Fix an assertion-on-error during tentative constructor parsing by propagating error conditions out of the various annotate-me-a-snowflake routines. Generally (but not universally) removes redundant diagnostics as well as, you know, not crashing on bad code. On the other hand, I have just signed myself up to fix fiddly parser errors for the next week. Again. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97221 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp
|
dc0a11cf52cf34ffae941255df60a086e44d1a71 |
26-Feb-2010 |
Douglas Gregor <dgregor@apple.com> |
An explicit specialization is allowed following an explicit instantiation so long as that explicit specialization was declared previously. Fixes PR6160. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97210 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p6.cpp
|
bf1764cf59e3158ad47dc1720a74490750923575 |
22-Feb-2010 |
Douglas Gregor <dgregor@apple.com> |
Do not require a complete type when checking for a pointer conversion between cv1 T* and cv2 T*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96787 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p6.cpp
|
fe3310697028d8d3d35a11b0877bb2bc47e55b8d |
13-Feb-2010 |
Douglas Gregor <dgregor@apple.com> |
Permit the use of typedefs of class template specializations in qualified declarator-ids. This patch is actually due to Cornelius; fixes PR6179. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96082 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p17.cpp
|
60c93c9981c467738369702e7aa23fd58c2b6aac |
09-Feb-2010 |
Douglas Gregor <dgregor@apple.com> |
Migrate the mish-mash of declaration checks in Sema::ActOnUninitializedDecl over to InitializationSequence (with default initialization), eliminating redundancy. More importantly, we now check that a const definition in C++ has an initilizer, which was an #if 0'd code for many, many months. A few other tweaks were needed to get everything working again: - Fix all of the places in the testsuite where we defined const objects without initializers (now that we diagnose this issue) - Teach instantiation of static data members to find the previous declaration, so that we build proper redeclaration chains. Previously, we had the redeclaration chain but built it too late to be useful, because... - Teach instantiation of static data member definitions not to try to check an initializer if a previous declaration already had an initializer. This makes sure that we don't complain about static const data members with in-class initializers and out-of-line definitions. - Move all of the incomplete-type checking logic out of Sema::FinalizeDeclaratorGroup; it makes more sense in ActOnUnitializedDecl. There may still be a few places where we can improve these diagnostics. I'll address that as a separate commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95657 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.mem/p5.cpp
|
dcee98048d5147502da2b224f01d08f24aec2293 |
09-Feb-2010 |
Douglas Gregor <dgregor@apple.com> |
When substituting a declaration non-type template argument for a non-type template parameter that has reference type, augment the qualifiers of the non-type template argument with those of the referenced type. Fixes PR6250. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95607 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p5.cpp
|
35911ce76bed5fa64dcc368cbd81f6ec7b71aa75 |
08-Feb-2010 |
Sebastian Redl <sebastian.redl@getdesigned.at> |
Add a test case for r95555. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95562 91177308-0d34-0410-b5e6-96231b3b80d8
emp.names/p4.cpp
|
e41ac7b007d64b504f8e79b97839d060a3669171 |
05-Feb-2010 |
Douglas Gregor <dgregor@apple.com> |
Fix a bogus assertion after adjusting the type of a substituted non-type template argument for a non-type template parameter of pointer type. Fixes PR6244. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95447 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p5.cpp
|
86a7625062abbd40fffa186f2f5d305cc89615b8 |
04-Feb-2010 |
Douglas Gregor <dgregor@apple.com> |
When substituting the template argument for a pointer non-type template parameter, perform array/function decay (if needed), take the address of the argument (if needed), perform qualification conversions (if needed), and remove any top-level cv-qualifiers from the resulting expression. Fixes PR6226. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95309 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p5.cpp
|
5147fa6d580e4c123d0a90fa737f40824f50aa50 |
03-Feb-2010 |
Chandler Carruth <chandlerc@gmail.com> |
Fix PR6149 by looking at the qualifiers on the referred to type for non-type reference template arguments. Adds test cases for the cv-quals of reference arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95217 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p5.cpp
|
0519fe2e11ae60d297b50f5497761045783f79c7 |
02-Feb-2010 |
John McCall <rjmccall@apple.com> |
FIXME complete. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95059 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp
|
5920dbba965a2f2a963313d94be3ff3d2b67ece7 |
02-Feb-2010 |
John McCall <rjmccall@apple.com> |
Improve the diagnostic used when an incompatible overload set is passed as an argument during overload resolution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95057 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp
|
eff92135d32039c9874dc356f3e93143af6069c1 |
02-Feb-2010 |
John McCall <rjmccall@apple.com> |
Implement C++ [temp.deduct.call]p6, template argument deduction for overloaded arguments. Fix a bug where incomplete explicit specializations were being passed through as legitimate. Fix a bug where the absence of an explicit specialization in an overload set was causing overall deduction to fail. Fixes PR6191. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95052 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p6.cpp
|
342fec43c515184a3c0d0600323dfec2b059e74e |
01-Feb-2010 |
John McCall <rjmccall@apple.com> |
Note that an overload candidate was non-viable because template argument deduction failed. Right now there's a very vague diagnostic for most cases and a good diagnostic for incomplete deduction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94988 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
|
038cc399940deefc0f55aad8be97312a7390e2ad |
31-Jan-2010 |
Chandler Carruth <chandlerc@gmail.com> |
Fix PR6159 and several other problems with value-dependent non-type template arguments. This both prevents meaningless checks on these arguments and ensures that they are represented as an expression by the instantiation. Cleaned up and added standard text to the relevant test case. Also started adding tests for *rejected* cases. At least one FIXME here where (I think) we allow something we shouldn't. More to come in the area of rejecting crazy arguments with decent diagnostics. Suggestions welcome for still better diagnostics on these errors! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94953 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1.cpp
|
b7de181d912690958e82c01f1b3d752d3d4ab43b |
31-Jan-2010 |
Chandler Carruth <chandlerc@gmail.com> |
Fix PR6156 and test several of the basic aspects of non-type template arguments when implicitly supplied to the injected class name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94948 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.local/p1.cpp
|
548028b3ca15926c6883357e111b47bbc56a4761 |
31-Jan-2010 |
Chandler Carruth <chandlerc@gmail.com> |
Handle instantiation of templates with non-type arguments expressed with an explicit '&' by introducing an address-of operator prior to checking the argument's type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94947 91177308-0d34-0410-b5e6-96231b3b80d8
emp.arg/temp.arg.nontype/p1.cpp
|
220ccbf2c9ef97034cce80561f9f46c4f1f63bc7 |
13-Jan-2010 |
John McCall <rjmccall@apple.com> |
Improve the reporting of non-viable overload candidates by noting the reason why the candidate is non-viable. There's a lot we can do to improve this, but it's a good start. Further improvements should probably be integrated with the bad-initialization reporting routines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93277 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.static/p1-inst.cpp
emp.decls/temp.class/temp.static/p1.cpp
emp.param/p3.cpp
emp.spec/temp.expl.spec/p4.cpp
emp.spec/temp.explicit/p1.cpp
|
9e68871f1e99e7e1536f16d5364fd5e2a352e9c4 |
11-Jan-2010 |
Douglas Gregor <dgregor@apple.com> |
When resolving a single function template specialization to a function, be sure to adjust the resulting argument type to a pointer (if necessary). Fixes PR5910 and PR5949. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93178 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3.cpp
|
9791bdc9b67435376f0b65686b627f5b3c6d1869 |
11-Jan-2010 |
Douglas Gregor <dgregor@apple.com> |
Test case for naming of conversion function template specializations git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93177 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.mem/p5.cpp
|
21714013498fd84a6e8d5ceb1af5d14b6531cfb5 |
06-Jan-2010 |
Douglas Gregor <dgregor@apple.com> |
Add test from PR5913, which has already been fixed git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92863 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
b1622a1fd7b7f4ab8d00d0183d17c90ad25c14e3 |
06-Jan-2010 |
John McCall <rjmccall@apple.com> |
Improve the diagnostics used to report implicitly-generated class members as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions. Adjust a lot of tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92832 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.static/p1-inst.cpp
emp.decls/temp.class/temp.static/p1.cpp
emp.param/p3.cpp
emp.spec/temp.expl.spec/p15.cpp
emp.spec/temp.expl.spec/p4.cpp
emp.spec/temp.explicit/p1.cpp
|
442471309fa97348f849687a6a8ef4acc3bc2c1f |
04-Jan-2010 |
Douglas Gregor <dgregor@apple.com> |
Make sure to use ASTContext::getAs*ArrayType() when decomposing array types. Fixes APFloat.cpp compilation failure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92523 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
a91eb541a6adf81acf872e7315bc6b814c3241eb |
22-Dec-2009 |
Eli Friedman <eli.friedman@gmail.com> |
Switch file-scope assignment initialization over to InitializationSequence. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91881 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1.cpp
emp.spec/temp.explicit/p10.cpp
|
4b52e25f3b05ab0f9d2492276a52323a50a84fb7 |
22-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
When a template-id refers to a single function template, and the explicitly-specified template arguments are enough to determine the instantiation, and either template argument deduction fails or is not performed in that context, we can resolve the template-id down to a function template specialization (so sayeth C++0x [temp.arg.explicit]p3). Fixes PR5811. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91852 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3-nodeduct.cpp
|
745880f35066bdb1950d0e870608295221346fc5 |
20-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
Switch default-initialization of variables of class type (or array thereof) over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91796 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p15.cpp
emp.spec/temp.expl.spec/p4.cpp
emp.spec/temp.explicit/p1.cpp
|
7a1dc562d4ad59237ed9fe7e8cef56f9eaa7a26c |
19-Dec-2009 |
John McCall <rjmccall@apple.com> |
Refactor to remove more dependencies on PreDeclaratorDC. I seem to have made the redeclaration problems in the [temp.explicit]p3 testcase worse, but I can live with that; they'll need to be fixed more holistically anyhow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91771 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p3.cpp
|
7abfbdbc97ad8e7f340789f751df1e32b10118b4 |
19-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
Switch more of Sema::CheckInitializerTypes over to InitializationSequence. Specially, switch initialization of a C++ class type (either copy- or direct-initialization). Also, make sure that we create an elidable copy-construction when performing copy initialization of a C++ class variable. Fixes PR5826. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91750 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.static/p1-inst.cpp
emp.decls/temp.class/temp.static/p1.cpp
emp.param/p3.cpp
|
18ef5e28a9a2677f8b1dce1fb2638d66e0a1621f |
18-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
Switch the initialization required by return statements over to the new InitializationSequence. This fixes some bugs (e.g., PR5808), changed some diagnostics, and caused more churn than expected. What's new: - InitializationSequence now has a "C conversion sequence" category and step kind, which falls back to - Changed the diagnostics for returns to always have the result type of the function first and the type of the expression second. CheckSingleAssignmentConstraints to peform checking in C. - Improved ASTs for initialization of return values. The ASTs now capture all of the temporaries we need to create, but intentionally do not bind the tempoary that is actually returned, so that it won't get destroyed twice. - Make sure to perform an (elidable!) copy of the class object that is returned from a class. - Fix copy elision in CodeGen to properly see through the subexpressions that occur with elidable copies. - Give "new" its own entity kind; as with return values and thrown objects, we don't bind the expression so we don't call a destructor for it. Note that, with this patch, I've broken returning move-only types in C++0x. We'll fix it later, when we tackle NRVO. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91669 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.static/p1.cpp
|
578b69b186d9cba0a6ae1dd7f4c04cd6a49f0aac |
16-Dec-2009 |
John McCall <rjmccall@apple.com> |
Introduce a centralized routine in Sema for diagnosing failed lookups (when used as expressions). In dependent contexts, try to recover by doing a lookup in previously-dependent base classes. We get better diagnostics out, but unfortunately the recovery fails: we need to turn it into a method call expression, not a bare call expression. Thus this is still a WIP. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91525 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
|
a5728872c7702ddd09537c95bc3cbd20e1f2fb09 |
15-Dec-2009 |
Daniel Dunbar <daniel@zuster.org> |
Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'. - 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/p6.cpp
emp.decls/temp.class.spec/temp.class.order/p2.cpp
emp.decls/temp.class.spec/temp.class.spec.mfunc/p1-neg.cpp
emp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp
emp.decls/temp.class/temp.mem.class/p1.cpp
emp.decls/temp.class/temp.mem.func/p1-retmem.cpp
emp.decls/temp.class/temp.mem.func/p1.cpp
emp.decls/temp.class/temp.mem.func/p1inst.cpp
emp.decls/temp.class/temp.mem.func/pr5056.cpp
emp.decls/temp.class/temp.static/p1-inst.cpp
emp.decls/temp.class/temp.static/p1.cpp
emp.decls/temp.fct/temp.func.order/p4.cpp
emp.decls/temp.fct/temp.func.order/p5.cpp
emp.decls/temp.fct/temp.over.link/p4-neg.cpp
emp.decls/temp.fct/temp.over.link/p4.cpp
emp.decls/temp.fct/temp.over.link/p6.cpp
emp.decls/temp.friend/p1.cpp
emp.decls/temp.friend/p3.cpp
emp.decls/temp.friend/p5.cpp
emp.decls/temp.mem/p1.cpp
emp.fct.spec/temp.arg.explicit/p1.cpp
emp.fct.spec/temp.arg.explicit/p3.cpp
emp.fct.spec/temp.deduct/sfinae-1.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p2.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
emp.fct.spec/temp.deduct/temp.deduct.conv/p2.cpp
emp.fct.spec/temp.deduct/temp.deduct.conv/p3.cpp
emp.fct.spec/temp.deduct/temp.deduct.conv/p4.cpp
emp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp
emp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp
emp.param/p10.cpp
emp.param/p11.cpp
emp.param/p12.cpp
emp.param/p13.cpp
emp.param/p14.cpp
emp.param/p15-cxx0x.cpp
emp.param/p15.cpp
emp.param/p2.cpp
emp.param/p3.cpp
emp.param/p4.cpp
emp.param/p7.cpp
emp.param/p8.cpp
emp.param/p9.cpp
emp.res/temp.dep.res/temp.point/p1.cpp
emp.res/temp.dep/p3.cpp
emp.spec/p5.cpp
emp.spec/temp.expl.spec/p1.cpp
emp.spec/temp.expl.spec/p10.cpp
emp.spec/temp.expl.spec/p11.cpp
emp.spec/temp.expl.spec/p13.cpp
emp.spec/temp.expl.spec/p14.cpp
emp.spec/temp.expl.spec/p15.cpp
emp.spec/temp.expl.spec/p16.cpp
emp.spec/temp.expl.spec/p17.cpp
emp.spec/temp.expl.spec/p18.cpp
emp.spec/temp.expl.spec/p19.cpp
emp.spec/temp.expl.spec/p2.cpp
emp.spec/temp.expl.spec/p20.cpp
emp.spec/temp.expl.spec/p21.cpp
emp.spec/temp.expl.spec/p3.cpp
emp.spec/temp.expl.spec/p4.cpp
emp.spec/temp.expl.spec/p5.cpp
emp.spec/temp.expl.spec/p6.cpp
emp.spec/temp.expl.spec/p9.cpp
emp.spec/temp.explicit/p1-0x.cpp
emp.spec/temp.explicit/p1-emit.cpp
emp.spec/temp.explicit/p1.cpp
emp.spec/temp.explicit/p10.cpp
emp.spec/temp.explicit/p12.cpp
emp.spec/temp.explicit/p2.cpp
emp.spec/temp.explicit/p3.cpp
emp.spec/temp.explicit/p4.cpp
emp.spec/temp.explicit/p5.cpp
emp.spec/temp.explicit/p6.cpp
emp.spec/temp.explicit/p7.cpp
emp.spec/temp.explicit/p8.cpp
emp.spec/temp.explicit/p9-linkage.cpp
emp.spec/temp.explicit/p9.cpp
|
5cc07df89ab9afa9079baeec1243ee90c3f84d9d |
15-Dec-2009 |
Douglas Gregor <dgregor@apple.com> |
Fix some diagnostic-related FIXMEs, from Nicola Gigante git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91433 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1.cpp
|
4b2b02b26cd51e2e44fa315143618285fd72ce77 |
15-Dec-2009 |
John McCall <rjmccall@apple.com> |
Diagnose the use of typedefs for template specialization types in the scope specifiers for out-of-line declarations, e.g. typedef Temp<int> MyTemp; template <> MyTemp::foo; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91395 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p17.cpp
|
5b6d70e2dece713de82612ffbac2f2bc5c367f73 |
25-Nov-2009 |
Douglas Gregor <dgregor@apple.com> |
Diagnose ill-formed uses of default template arguments in function templates (in C++98), friend function templates, and out-of-line definitions of members of class templates. Also handles merging of default template arguments from previous declarations of function templates, for C++0x. However, we don't yet make use of those default template arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89872 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p9.cpp
|
74295b3408178bd0e97c2090dac911817778b582 |
23-Nov-2009 |
Douglas Gregor <dgregor@apple.com> |
Canonical template arguments that are template template parameters by their template parameter depth and position, so that we can match redeclarations appropriately. Fixes PR5527 and PR5528. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89654 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1.cpp
|
98440b4ac17dc5f85ea3db683c1c1785449c17e1 |
21-Nov-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement C++ [temp.param]p2 correctly, looking ahead when we see a "typename" parameter to distinguish between non-type and type template parameters. Fixes the actual bug in PR5559. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89532 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p2.cpp
|
a481edb1b11c956a46cb42cd0dc4dd9851c10801 |
21-Nov-2009 |
Douglas Gregor <dgregor@apple.com> |
Cope with extraneous "template" keyword when providing an out-of-line definition of a member template (or a member thereof). Fixes PR5566. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89512 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp
emp.decls/temp.class/temp.mem.func/p1.cpp
|
f35f828f9883123772a9731af190a608f3236ef4 |
11-Nov-2009 |
Douglas Gregor <dgregor@apple.com> |
Improve diagnostics when a default template argument does not match with its corresponding template parameter. This can happen when we performed some substitution into the default template argument and what we had doesn't match any more, e.g., template<int> struct A; template<typename T, template<T> class X = A> class B; B<long> b; Previously, we'd emit a pretty but disembodied diagnostic showing how the default argument didn't match the template parameter. The diagnostic was good, but nothing tied it to the *use* of the default argument in "B<long>". This commit fixes that. Also, tweak the counting of active template instantiations to avoid counting non-instantiation records, such as those we create for (surprise!) checking default arguments, instantiating default arguments, and performing substitutions as part of template argument deduction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86884 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p12.cpp
|
9148c3f5829f4d031249faeb1043e7be914539e8 |
11-Nov-2009 |
Douglas Gregor <dgregor@apple.com> |
Before checking a template template argument against its corresponding template template parameter, substitute any prior template arguments into the template template parameter. This, for example, allows us to properly check the template template argument for a class such as: template<typename T, template<T Value> class X> struct Foo; The actual implementation of this feature was trivial; most of the change is dedicated to giving decent diagnostics when this substitution goes horribly wrong. We now get a note like: note: while substituting prior template arguments into template template parameter 'X' [with T = float] As part of this change, enabled some very pedantic checking when comparing template template parameter lists, which shook out a bug in our overly-eager checking of default arguments of template template parameters. We now perform only minimal checking of such default arguments when they are initially parsed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86864 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p12.cpp
|
80c30dad6c6fca077293125a96f464b6c8857171 |
09-Nov-2009 |
Eli Friedman <eli.friedman@gmail.com> |
Add additional note to mark the cause of synthesized constructors. Mark declaration invalid if the constructor can't be properly built. Addresses remaining review comments from Fariborz for r86500. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86579 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p4.cpp
|
49c16da71b9c95cc53b4af6de2833a022cb69b6a |
09-Nov-2009 |
Eli Friedman <eli.friedman@gmail.com> |
Unify the codepaths used to verify base and member initializers for explicitly and implicitly defined constructors. This has a number of benefits: 1. Less code. 2. Explicit and implicit constructors get the same diagnostics. 3. The AST explicitly contains constructor calls from implicit default constructors. This allows handing some cases that previously weren't handled correctly in IRGen without any additional code. Specifically, implicit default constructors containing calls to constructors with default arguments are now handled correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86500 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p4.cpp
|
2475d76920b43014e661690836642ca3c9967179 |
08-Nov-2009 |
Daniel Dunbar <daniel@zuster.org> |
Remove RUN: true lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86432 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p1.cpp
|
4fcfde4d5c8f25e40720972a5543d538a0dcb220 |
08-Nov-2009 |
Daniel Dunbar <daniel@zuster.org> |
Eliminate &&s in tests. - 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p3.cpp
|
d73902121a93c3135cf53e2d724361cec1037d7e |
03-Nov-2009 |
Daniel Dunbar <daniel@zuster.org> |
Switch XFAIL format to match LLVM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85880 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p14.cpp
emp.res/temp.dep.res/temp.point/p1.cpp
|
3f9a0566e6793151b99a65ab936220971cf96c1b |
03-Nov-2009 |
Douglas Gregor <dgregor@apple.com> |
Introduce a new class, UnqualifiedId, that provides a parsed representation of a C++ unqualified-id, along with a single parsing function (Parser::ParseUnqualifiedId) that will parse all of the various forms of unqualified-id in C++. Replace the representation of the declarator name in Declarator with the new UnqualifiedId class, simplifying declarator-id parsing considerably and providing more source-location information to Sema. In the future, I hope to migrate all of the other unqualified-id-parsing code over to this single representation, then begin to merge actions that are currently only different because we didn't have a unqualified notion of the name in the parser. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85851 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p3.cpp
|
c78c06d81f9838aea4198e4965cc1b26bb0bf838 |
30-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Improved fix for PR3844, which recovers better for class template partial specializations and explicit instantiations of non-templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85620 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p5.cpp
|
2cc782f7932f1069d9fa8bb5c518165802aad68d |
30-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Improve diagnostics when parsing something like template<> struct foo<int> { ... }; where "foo" does not refer to a template. Fixes PR3844. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85616 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p3.cpp
emp.spec/temp.explicit/p5.cpp
|
e8c01bdb56549adcecd71ce39160eea54b2c51c8 |
30-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Instantiate class template friends better; fixes PR5332. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85612 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
ed9c0f90b7e0811c209b95e39fe07c211c531285 |
29-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement support for semantic checking and template instantiation of class template partial specializations of member templates. Also, fixes a silly little bug in the marking of "used" template parameters in member templates. Fixes PR5236. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85447 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/p6.cpp
|
268fb5bca1372e6dcd39a3d8d5a29341915ed919 |
28-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Test explicit-instantiation-declaration-after-explicit-instantiation-definition errors. This wraps up explicit template instantiation for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85347 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p10.cpp
|
7d9c3c92c90ae36d58ec21bc53c4c08e02ac3555 |
28-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement proper linkage for explicit instantiation declarations of inlined functions. For example, given template<typename T> class string { unsigned Len; public: unsigned size() const { return Len; } }; extern template class string<char>; we now give the instantiation of string<char>::size available_externally linkage (if it is ever instantiated!), as permitted by the C++0x standard. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85340 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p9-linkage.cpp
|
3b846b6c252972a6f142aa226c1e65aebd0feeca |
27-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Explicit instantiation suppresses the instantiation of non-inline function template specializations and member functions of class template specializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85300 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p9.cpp
|
0d03514da06dffb39a260a1228ea3fd01d196fa4 |
27-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
An explicit instantiation definition only instantiations those class members that have a definition. Also, use CheckSpecializationInstantiationRedecl as part of this instantiation to make sure that we diagnose the various kinds of problems that can occur with explicit instantiations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85270 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p8.cpp
|
7d5ba55f58c070e5b9f8cee3a172e2da1fcd02af |
27-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Test for interaction between explicit instantiations and specializations git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85244 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p7.cpp
|
e46c7f524297452e1c9800792e403beca6c92a1a |
27-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Test various aspects of explicit instantiation that were already implemented. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85243 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p12.cpp
emp.spec/temp.explicit/p5.cpp
emp.spec/temp.explicit/p6.cpp
|
972e6ce33c7e307f4b0da12bd6079bbd6ef76948 |
27-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Only set the point of instantiation for an implicit or explicit instantiation once we have committed to performing the instantiation. As part of this, make our makeshift template-instantiation location information suck slightly less. Fixes PR5264. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85209 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p3.cpp
|
583f33b8a9227bace1a77a15404b4c64dc619d69 |
15-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Make sure that we're diagnosing duplicate explicit instantiation definitions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84189 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/p5.cpp
|
454885ec4f59959a01a2c7861b88abdea8617147 |
15-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Check the interactions between explicit instantiations and template specializations. Work in progress; there's more cleanup required to actually use the new CheckSpecializationInstantiationRedecl checker uniformly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84185 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p4.cpp
|
e2d3a3de71b2fa35614cb732a6da95a41fa38ad9 |
15-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Diagnose explicit instantiations of function templates and member functions/static data members of class template specializations that do not have definitions. This is the latter part of [temp.explicit]p4; the former part still needs more testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84182 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-0x.cpp
emp.spec/temp.explicit/p2.cpp
emp.spec/temp.explicit/p4.cpp
|
bf7643e7966cd9acd797a84870018034112e49d3 |
15-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
More explicit template instantiation. Now we're checking for more cases where an explicit instantiation requires a definition; the remainder of these checks will come with the implementation of paragraph 4 of [temp.explicit]. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84181 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p3.cpp
|
558c03222c77873a934b002073667a3c971fe8a9 |
15-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Additional semantic checking for explicit template instantiations, focusing on the scope- and qualifier-related semantic requirements in C++ [temp.explicit]p2. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84154 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p2.cpp
|
9ada570e77bdd8334a86528b07e5569d00750b3c |
14-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Check the implicit instantiation of a static data member of a class template that has no out-of-line definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84141 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-emit.cpp
|
1028c9f0afc1cc5f4951b39b7067fa57c1fea07b |
14-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Give explicit and implicit instantiations of static data members of class templates the proper linkage. Daniel, please look over the CodeGenModule bits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84140 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-emit.cpp
|
663b5a0be7261c29bc4c526a71cffcfa02d4153e |
14-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Testing and some minor fixes for explicit template instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84129 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.explicit/p1-0x.cpp
emp.spec/temp.explicit/p1.cpp
|
3f09327b26033d0a9676d52d80cf92c48f581aff |
13-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Unify our diagnostic printing for errors of the form, "we didn't like what we found when we looked into <blah>", where <blah> is a DeclContext*. We can now format DeclContext*'s in nice ways, e.g., "namespace N", "the global namespace", "'class Foo'". This is part of PR3990, but we're not quite there yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84028 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p18.cpp
|
096ebfda90b35a5cd6e399920fca7d9b5b0859f3 |
13-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Diagnose attempts to add default function arguments to a specialization. This completes C++ [temp.expl.spec]! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83980 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p21.cpp
|
fd056bc86a8b22a9421b5d921bbca276d0f9d0f7 |
13-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
When explicitly specializing a member that is a template, mark the template as a specialization. For example, this occurs with: template<typename T> struct X { template<typename U> struct Inner { /* ... */ }; }; template<> template<typename T> struct X<int>::Inner { T member; }; We need to treat templates that are member specializations as special in two contexts: - When looking for a definition of a member template, we look through the instantiation chain until we hit the primary template *or a member specialization*. This allows us to distinguish between the primary "Inner" definition and the X<int>::Inner definition, above. - When computing all of the levels of template arguments needed to instantiate a member template, don't add template arguments from contexts outside of the instantiation of a member specialization, since the user has already manually substituted those arguments. Fix up the existing test for p18, which was actually wrong (but we didn't diagnose it because of our poor handling of member specializations of templates), and add a new test for member specializations of templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83974 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p18.cpp
emp.spec/temp.expl.spec/p19.cpp
|
a735b206fdb5c15767a45289e1ffb3b568f70f2b |
13-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Improve the internal representation and semantic analysis of friend function templates. This commit ensures that friend function templates are constructed as FunctionTemplateDecls rather than partial FunctionDecls (as they previously were). It then implements template instantiation for friend function templates, injecting the friend function template only when no previous declaration exists at the time of instantiation. Oh, and make sure that explicit specialization declarations are not friends. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83970 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p20.cpp
|
f0510d49a6985e9284d30cfc36a0df2a6292a638 |
13-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
When declaring a class template whose name is qualified, make sure that the scope in which it is being declared is complete. Also, when instantiating a member class template's ClassTemplateDecl, be sure to delay type creation so that the resulting type is dependent. Ick. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83923 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p18.cpp
|
38d840486d2b4ecafd32af9ad48f594f5cdb6199 |
13-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Test explicit specialization involving multiple template<> headers git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83914 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p17.cpp
|
37d68185088947322a97eabdc1c0714b0debd929 |
13-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Permit explicit specialization of member functions of class templates that are declarations (rather than definitions). Also, be sure to set the access specifiers properly when instantiating the declarations of member function templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83911 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p16.cpp
|
65f6642e88ac39f2c1129f9b92b3fafd55dc32df |
12-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Test explicit specializations of static data members that are declarations, not definitions git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83904 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p15.cpp
|
27c8235def85fc7f92fcaffe7907eef0552ca209 |
12-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Yet another test for explicit specialization, this one involving linkage git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83901 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p14.cpp
|
09748395ab88f7f4678c9ff048fd035174dba519 |
12-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
More tests for explicit template specialization git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83896 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p10.cpp
emp.spec/temp.expl.spec/p11.cpp
emp.spec/temp.expl.spec/p13.cpp
emp.spec/temp.expl.spec/p9.cpp
|
459180b1eb2a8db03cc996bc33e320e5ee44daca |
12-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Add test for last commit git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83893 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p6.cpp
|
0c728f1eb2e8e6e5adc2501c6fdcd87105b34d5c |
09-Oct-2009 |
Fariborz Jahanian <fjahanian@apple.com> |
Fix up error reporting when object cannot be constructed because of missing default constructor of a member. Fixes pr5154. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83583 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p4.cpp
|
9916a047c55ea18845d706bf95e7517b646933d0 |
08-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Add more testing for the properties of explicit specialization. Also, eliminate a redundant diagnostic by marking a variable declared with incomplete type as an invalid declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83553 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p3.cpp
emp.spec/temp.expl.spec/p4.cpp
emp.spec/temp.expl.spec/p5.cpp
|
741fab61570f145a52b808a6824841c41e892c28 |
08-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Don't complain about out-of-line explicit specializations of member function and member function templates that are not definitions. Add more tests to ensure that explicit specializations of member function templates prevent instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83550 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
42887b9224e1d47372fb8a00cba27c925924fa52 |
08-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
More testing for explicit specializations of member class templates git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83548 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
f6b1185f0a8a209c06dfc1efdb6a59cc851e970c |
08-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Improve checking for specializations of member classes of class templates, and keep track of how those member classes were instantiated or specialized. Make sure that we don't try to instantiate an explicitly-specialized member class of a class template, when that explicit specialization was a declaration rather than a definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83547 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
251b4ff2578e26959a4c036140ccd61c5e9292f2 |
08-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
For instantiations of static data members of class templates, keep track of the kind of specialization or instantiation. Also, check the scope of the specialization and ensure that a specialization declaration without an initializer is not a definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83533 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
63e5e64a49ef936383ad93ea283b2b07f115e78c |
08-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Only perform an implicit instantiation of a function if its template specialization kind is TSK_ImplicitInstantiation. Previously, we would end up implicitly instantiating functions that had explicit specialization declarations or explicit instantiation declarations (with no corresponding definitions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83511 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
1fef4e60e7e884803977a8376c172ea584f8a5d1 |
08-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Type checking for specializations of member functions of class templates. Previously, these weren't handled as specializations at all. The AST for representing these as specializations is still a work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83498 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
0a4074768a6ecd81513f0db02bfb0e96ab3e56a0 |
07-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Diagnose explicit instantiations and specializations that occur in class scope git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83473 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
7974c3b7062f85bb7c0ada34526cdefe1d30f89b |
07-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Class template partial specializations can be declared anywhere that its definition may be defined, including in a class. Also, put in an assertion when trying to instantiate a class template partial specialization of a member template, which is not yet implemented. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83469 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/p6.cpp
|
3d92d8c94e9447a6d903241e180590b4025c5927 |
07-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
More testing of explicit specializations git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83440 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p2.cpp
|
d5cb8765ad3841ead8eaacb0360ac385f2f0e080 |
07-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Refactor checking of the scope of explicit template specialization declarations and explicit template instantiations, improving diagnostics and making the code usable for function template specializations (as well as class template specializations and partial specializations). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83436 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p1.cpp
emp.spec/temp.expl.spec/p2.cpp
|
13d2d6cfd6a0032402c98b4fa237526c5b40e3fb |
06-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Test explicit specialization for all of the various cases where explicit specializations can occur. Also, fix a minor recovery bug where we should allow declarations coming from the parser to be NULL. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83416 91177308-0d34-0410-b5e6-96231b3b80d8
emp.spec/temp.expl.spec/p1.cpp
|
4a5c15f75f76b95e1c2ceb6fa2737dcadd5f4be1 |
01-Oct-2009 |
Douglas Gregor <dgregor@apple.com> |
Improve template argument deduction in the case where the parameter type is a template-id (e.g., basic_ostream<CharT, Traits>) and the argument type is a class that has a derived class matching the parameter type. Previously, we were giving up on template argument deduction too early. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83177 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
d04b1be7d3015a307f93eea0b9ab0ecce612951e |
28-Sep-2009 |
Douglas Gregor <dgregor@apple.com> |
Make sure that out-of-line function and variable definitions are not pushed into scope. Fixes PR5056. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83003 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/pr5056.cpp
|
d85bea2affdd59d83d1be7d24b97f436484c3625 |
26-Sep-2009 |
Douglas Gregor <dgregor@apple.com> |
Rework the Parse-Sema interaction for friends to better support friend class templates. We now treat friend class templates much more like normal class templates, except that they still get special name lookup rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in <iostream>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82848 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p3.cpp
|
dd4a3b0065b9a7e7b00073df415a798886c090f3 |
17-Sep-2009 |
John McCall <rjmccall@apple.com> |
Improved representation and support for friend class templates. Angst about same. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82088 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p3.cpp
emp.decls/temp.friend/p5.cpp
|
9eea08ba72f8b1e7faf38e43376b9157fc4a2af2 |
15-Sep-2009 |
Douglas Gregor <dgregor@apple.com> |
Slightly improved template argument deduction for use in partial ordering, along with another test case for partial ordering of partial specializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81869 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/temp.class.order/p2.cpp
|
05b23ea2119b4c411719bd6631e5d679ba5e7ef1 |
14-Sep-2009 |
John McCall <rjmccall@apple.com> |
Skeletal support for friend class templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81801 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p5.cpp
|
e73bb60de3c7c60453a86e097fc428d1cd367a42 |
14-Sep-2009 |
Douglas Gregor <dgregor@apple.com> |
Refactor MarkDeductedTemplateParameters into MarkUsedTemplateParameters, which is able to mark template parameters used within non-deduced contexts as well as deduced contexts. Use this to finish the implementation of [temp.deduct.partial]p11. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81794 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp
|
1282029f3d37f482bbba3c38ea9da17a78d11d40 |
14-Sep-2009 |
Douglas Gregor <dgregor@apple.com> |
Tighten up checking of non-dependent arguments as part of template argument deduction. This fixes the new test case (since partial ordering does not have a "verify the results of deduction" step), and will allow failed template argument deductions to return more quickly for, e.g., matching class template partial specializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81779 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.partial/p11.cpp
|
8a51491d936d8c50480f3c3ca6647be12a7ad51f |
14-Sep-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement partial ordering of function template specializations (C++ [temp.func.order]). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81777 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.fct/temp.func.order/p4.cpp
emp.decls/temp.fct/temp.func.order/p5.cpp
|
4719f4e86a84dec6f5a45771ae51d4ec72e4617a |
12-Sep-2009 |
Douglas Gregor <dgregor@apple.com> |
When performing name lookup within a class template or class template partial specialization, make sure we look into non-dependent base classes (but not dependent base classes). Fixes PR4951. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81584 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.dep/p3.cpp
|
6b2becfc434b0bdced8560802c4d0e03148c61b8 |
08-Sep-2009 |
John McCall <rjmccall@apple.com> |
Support templateids in friend declarations. Fixes bug 4859. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81233 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
82b9fb8e7a05066e690670d2eb386a624b04f684 |
02-Sep-2009 |
John McCall <rjmccall@apple.com> |
Borrow a friend class's previous declaration's access specifier regardless of whether the current context is dependent. Thanks to Anders for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80828 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
1a26c27eba32f8766c0eeec73fe43634cd814825 |
02-Sep-2009 |
John McCall <rjmccall@apple.com> |
Fix a little crasher in friend decls. Thanks again to Eli for finding this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80748 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
2a29c4b6ef710de49b1fd72902d6930033edae24 |
29-Aug-2009 |
John McCall <rjmccall@apple.com> |
Fix a last-minute typo and make the test not emit temporaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80419 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
f181d8a44f5837213eeaee6d71f584b1ab2849cd |
29-Aug-2009 |
John McCall <rjmccall@apple.com> |
Ensure code generation for friend declarations in class templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80418 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
02cace78cf48cc26686bd5b07c78606abca13bcd |
28-Aug-2009 |
John McCall <rjmccall@apple.com> |
Omnibus friend decl refactoring. Instead of cloning AST classes for friend declarations of same, introduce a single AST class and add appropriate bits (encoded in the namespace) for whether a decl is "real" or not. Much hackery about previously-declared / not-previously-declared, but it's essentially mandated by the standard that friends alter lookup, and this is at least fairly non-intrusive. Refactor the Sema methods specific to friends for cleaner flow and less nesting. Incidentally solve a few bugs, but I remain confident that we can put them back. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80353 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
6dd38daf1495367db8fe9e9a5cacb7420cf08e27 |
27-Aug-2009 |
Douglas Gregor <dgregor@apple.com> |
When checking whether one declaration context encloses another, make sure to look at the primary contexts. Thanks to Eli for the test case git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80212 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1.cpp
|
dacd434c49658286c380c7b4c357d76d53cb4aa1 |
26-Aug-2009 |
Douglas Gregor <dgregor@apple.com> |
Improve diagnostics and recovery when the nested-name-specifier of a qualified name does not actually refer into a class/class template/class template partial specialization. Improve printing of nested-name-specifiers to eliminate redudant qualifiers. Also, make it possible to output a nested-name-specifier through a DiagnosticBuilder, although there are relatively few places that will use this leeway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80056 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1.cpp
|
06c0f5b1bb1623a93a2bc4c345fb3be52a2b22a7 |
23-Aug-2009 |
Chris Lattner <sabre@nondot.org> |
Eli points out that we really must diagnose "void* > 0" as an extension. Explicitly add it as an EXTENSION instead of an EXTWARN so that it only comes out with -pedantic. Thanks Eli! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79791 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp
|
d83d04041f64a2c89123d227fa8003b482391279 |
22-Aug-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement delayed parsing for member function templates. Fixes PR4608. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79709 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.conv/p4.cpp
|
65ec1fda479688d143fe2403242cd9c730c800a1 |
22-Aug-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement conversion function templates, along with the ability to use template argument deduction from a conversion function (C++ [temp.deduct.conv]) with implicit conversions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79693 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.conv/p2.cpp
emp.fct.spec/temp.deduct/temp.deduct.conv/p3.cpp
emp.fct.spec/temp.deduct/temp.deduct.conv/p4.cpp
|
17e32f30e2d1eaf6639d3d4e2196a8d7c709fbac |
22-Aug-2009 |
Douglas Gregor <dgregor@apple.com> |
Refactor instantiation of destructors to use the common CXXMethodDecl code, fixing a problem where instantiations of out-of-line destructor definitions would had the wrong lexical context. Introduce tests for out-of-line definitions of the constructors, destructors, and conversion functions of a class template partial specialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79682 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp
|
1cbc6b044fac411ed97c2c97b6873439ac048c91 |
22-Aug-2009 |
Douglas Gregor <dgregor@apple.com> |
Add test for out-of-line definition of a conversion function git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79679 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1.cpp
|
ac373c4ca596a144d906570f284d46d702e10719 |
22-Aug-2009 |
Douglas Gregor <dgregor@apple.com> |
Fix parsing for out-of-line definitions of constructors and destructors of class templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79678 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1.cpp
|
e29ba20148e9b7835ad463b39cd4ee9223eafbbf |
20-Aug-2009 |
John McCall <rjmccall@apple.com> |
Basic nested-template implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79504 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.mem/p1.cpp
|
fd810b1386ed29b250e7d522ea826a65c815e49d |
14-Aug-2009 |
John McCall <rjmccall@apple.com> |
Support friend declarations in templates and test that argdep lookup still works. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78979 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.friend/p1.cpp
|
4a959d8788179d654df6b213b08d2b064989211d |
06-Aug-2009 |
Douglas Gregor <dgregor@apple.com> |
When we encounter a dependent type that was parsed before we know that we were going to enter into the scope of a class template or class template partial specialization, rebuild that type so that it can refer to members of the current instantiation, as in code like template<typename T> struct X { typedef T* pointer; pointer data(); }; template<typename T> typename X<T>::pointer X<T>::data() { ... } Without rebuilding the return type of this out-of-line definition, the canonical return type of the out-of-line definition (a TypenameType) will not match the canonical return type of the declaration (the canonical type of T*). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78316 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1-retmem.cpp
|
211c278e536b9f5bf468a99dc24449ad734466fe |
31-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Make the recanonicalization-for-an-out-of-line-definition test case a bit trickier git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77707 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1-retmem.cpp
|
b88e888404ad0a2bdd9bfae457e8530bb38a87c5 |
30-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Support out-of-line definitions of the members of class template partial specializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77606 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class.spec/temp.class.spec.mfunc/p1-neg.cpp
emp.decls/temp.class.spec/temp.class.spec.mfunc/p1.cpp
|
828e226ab7ed08b3eb766549e9d3306432137460 |
29-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Use the new statement/expression profiling code to unique dependent template arguments, as in template specialization types. This permits matching out-of-line definitions of members for class templates that involve non-type template parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77462 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.fct/temp.over.link/p6.cpp
|
8bda2e66fa8050a6b3eef745628873eef4b683d8 |
28-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Add a template test that requires canonical expression comparison git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77325 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.fct/temp.over.link/p6.cpp
|
bc0a2226c7fcd18b29b6846049e2cfcb872d3593 |
27-Jul-2009 |
Owen Anderson <resistor@mac.com> |
Update for LLVM API change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77249 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.class/p1.cpp
emp.decls/temp.class/temp.mem.func/p1-retmem.cpp
emp.decls/temp.class/temp.mem.func/p1inst.cpp
emp.decls/temp.class/temp.static/p1-inst.cpp
emp.decls/temp.class/temp.static/p1.cpp
emp.fct.spec/temp.arg.explicit/p3.cpp
emp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp
|
8bf0ccd4c7e23a329f150323e2f9b474ff15c66c |
25-Jul-2009 |
Daniel Dunbar <daniel@zuster.org> |
Make having no RUN line a failure. Doug, please look at decltype-crash and instantiate-function-1.mm, I'm not sure if they are actually testing the right thing / anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77070 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p1.cpp
|
7caa6825f42a0f7e97d6fc06233133c42b218e46 |
24-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Template instantiation for static data members that are defined out-of-line. Note that this also fixes a bug that affects non-template code, where we were not treating out-of-line static data members are "file-scope" variables, and therefore not checking their initializers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77002 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.static/p1-inst.cpp
emp.decls/temp.class/temp.static/p1.cpp
|
7cdbc5832084f45721693dfb1d93284c3e08efee |
23-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement support for out-of-line definitions of the class members of class templates, e.g., template<typename T> struct Outer { struct Inner; }; template<typename T> struct Outer<T>::Inner { // ... }; Implementing this feature required some extensions to ActOnTag, which now takes a set of template parameter lists, and is the precursor to removing the ActOnClassTemplate function from the parser Action interface. The reason for this approach is simple: the parser cannot tell the difference between a class template definition and the definition of a member of a class template; both have template parameter lists, and semantic analysis determines what that template parameter list means. There is still some cleanup to do with ActOnTag and ActOnClassTemplate. This commit provides the basic functionality we need, however. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76820 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.class/p1.cpp
|
dfe3f2d8ba49f03d01f42570e640d9a6755e6c08 |
22-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement parsing and semantic analysis for out-of-line definitions of static data members of class templates. We don't instantiate the definitions yet, however. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76756 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.static/p1.cpp
|
5c7e281d368601858f9f5e5fe11734eea10b9523 |
22-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Test template instantiation for member functions of class templates defined out of line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76740 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1inst.cpp
|
7551c183e8d788b5254e9c6f8bd8d719cea47da8 |
22-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Complain if we're entering the context of a dependent nested-name-specifier but cannot match that nested-name-specifier to a class template or class template partial specialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76704 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1.cpp
|
f59a56e180bf54528d7d1d5afa68fcc13300965a |
22-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Basic parsing and semantic analysis for out-of-line definitions of the member functions of class templates, e.g., template<typename T> struct X { void f(T); }; template<typename T> X<T>::f(T) { /* ... */ } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76692 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.class/temp.mem.func/p1-retmem.cpp
emp.decls/temp.class/temp.mem.func/p1.cpp
|
cb077fc8e0d440f024bbdf57983b84b6d658b60b |
21-Jul-2009 |
Mike Stump <mrs@apple.com> |
Prep for new warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76640 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.fct/temp.over.link/p4-neg.cpp
|
83314aa1cf61ed2458a8a20c83b2d4708192d5dc |
08-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement template argument deduction when taking the address of a function template. Most of the change here is in factoring out the common bits used for template argument deduction from a function call and when taking the address of a function template. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75044 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.funcaddr/p1.cpp
|
de0cb8b6c15c756e14b0716bebd40f4ce48ee717 |
08-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Improve template argument deduction from a call. In particular, implement C++ [temp.deduct.call]p3b3, which allows a template-id parameter to match a derived class of the argument, while deducing template arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74965 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
41e8c21eb41fca41e2e065e75f01433427858c19 |
02-Jul-2009 |
Ted Kremenek <kremenek@apple.com> |
Fix RUN line so this test doesn't hang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74719 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/sfinae-1.cpp
|
cca9e9674a5e50a283185d8e9d8a5c3414eb008e |
02-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Keep track of more information within the template instantiation stack, e.g., by distinguishing between substitution that occurs for template argument deduction vs. explicitly-specifiad template arguments. This is used both to improve diagnostics and to make sure we only provide SFINAE in those cases where SFINAE should apply. In addition, deal with the sticky issue where SFINAE only considers substitution of template arguments into the *type* of a function template; we need to issue hard errors beyond this point, as test/SemaTemplate/operator-template.cpp illustrates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74651 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/sfinae-1.cpp
|
16134c62ef3d146e0dd0c76aafb906ff12c0a15d |
01-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Cope with explicitly-specified function template arguments when there are fewer template arguments than there are template parameters for that function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74578 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p3.cpp
|
6db8ed4498b83fe9336e3855a4ba1a298b04ee00 |
01-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
When explicit template arguments are provided for a function call, substitute those template arguments into the function parameter types prior to template argument deduction. There's still a bit of work to do to make this work properly when only some of the template arguments are specified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74576 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p1.cpp
|
edce4dd44732dfad69f28822dddcf2b8e92b4483 |
01-Jul-2009 |
Douglas Gregor <dgregor@apple.com> |
Preliminary parsing and ASTs for template-ids that refer to function templates, such as make<int&>. These template-ids are only barely functional for function calls; much more to come. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74563 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.arg.explicit/p1.cpp
|
508f1c889b9833903ea394034fe0246d3a57a32d |
27-Jun-2009 |
Douglas Gregor <dgregor@apple.com> |
During template argument deduction from a function call, allow deduction from pointer and pointer-to-member types to work even in the presence of a qualification conversion (C++ [temp.deduct.type]p3 bullet 2). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74354 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
8a5cb1196ee8491570160e36c216631df3a9e95c |
26-Jun-2009 |
Douglas Gregor <dgregor@apple.com> |
A little template argument deduction test uncovered an "oops". As part of template instantiation, we were dropping cv-qualifiers on the instantiated type in a few places. This change reshuffles the type-instantiation code a little bit so that there's a single place where we add qualifiers to the instantiated type, so that we won't end up with this same bug in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74331 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
f670c8cfa58b4c224eb8fb566130dc47844dd3de |
26-Jun-2009 |
Douglas Gregor <dgregor@apple.com> |
Template argument deduction is no longer responsible for checking non-dependent parameter types. Instead, class template partial specializations perform a final check of all of the instantiated arguments. This model is cleaner, and works better for function templates where the "final check" occurs during overload resolution. Also, cope with cv-qualifiers when the parameter type was originally a reference type, so that the deduced argument can be more qualified than the transformed argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74323 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
|
500d331eade2f5070b66ba51d777224f9fda6e1d |
26-Jun-2009 |
Douglas Gregor <dgregor@apple.com> |
Improve template argument deduction for reference parameters when deducing template arguments from a function call. Plus, add a bunch of tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74301 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/p2.cpp
emp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp
|
e53060fa78ad7e98352049f72787bdb7543e2a48 |
26-Jun-2009 |
Douglas Gregor <dgregor@apple.com> |
Improved semantic analysis and AST respresentation for function 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
emp.fct.spec/temp.deduct/temp.deduct.call/basic.cpp
|
34d1dc9f0ca8f5b0528a8cd29f1addfe096361b8 |
24-Jun-2009 |
Douglas Gregor <dgregor@apple.com> |
Implement matching of function templates, so that one can declare overloaded function templates. C++ [temp.over.link] paragraphs 4-8. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74079 91177308-0d34-0410-b5e6-96231b3b80d8
emp.decls/temp.fct/temp.over.link/p4-neg.cpp
emp.decls/temp.fct/temp.over.link/p4.cpp
|
e67068c5f90d7cbc39f970e951d7e8622c485838 |
23-Jun-2009 |
Douglas Gregor <dgregor@apple.com> |
Add a test illustrating our current inability to properly cope with the point of instantation of a member function of a class template specialization git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73956 91177308-0d34-0410-b5e6-96231b3b80d8
emp.res/temp.dep.res/temp.point/p1.cpp
|
247baca66ca998de9c415c19019e199f4895e81c |
13-Jun-2009 |
Douglas Gregor <dgregor@apple.com> |
Move a bunch of tests into temp.param, and write a few tests for paragraphs that hadn't been touched before git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73288 91177308-0d34-0410-b5e6-96231b3b80d8
emp.param/p1.cpp
emp.param/p10.cpp
emp.param/p11.cpp
emp.param/p12.cpp
emp.param/p13.cpp
emp.param/p14.cpp
emp.param/p15-cxx0x.cpp
emp.param/p15.cpp
emp.param/p2.cpp
emp.param/p3.cpp
emp.param/p4.cpp
emp.param/p7.cpp
emp.param/p8.cpp
|