Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4 |
|
#
a0651db4 |
| 10-Apr-2024 |
Younan Zhang <zyn7109@gmail.com> |
[clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (#87768)
There has been an optimization for `SizeOfPackExprs` since c5452ed9, in
which
we overlooked a case where th
[clang][Sema] Avoid guessing unexpanded packs' size in getFullyPackExpandedSize (#87768)
There has been an optimization for `SizeOfPackExprs` since c5452ed9, in
which
we overlooked a case where the template arguments were not yet
formed into a `PackExpansionType` at the token annotation stage. This
led to a problem in that a template involving such expressions may
lose its nature of being dependent, causing some false-positive
diagnostics.
Fixes https://github.com/llvm/llvm-project/issues/84220
show more ...
|
Revision tags: llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1 |
|
#
4848f3bf |
| 07-Sep-2022 |
Nicolas Lesser <blitzrakete@gmail.com> |
[C++2a] P0634r3: Down with typename!
This patch implements P0634r3 that removes the need for 'typename' in certain contexts.
For example,
``` template <typename T> using foo = T::type; // ok ```
[C++2a] P0634r3: Down with typename!
This patch implements P0634r3 that removes the need for 'typename' in certain contexts.
For example,
``` template <typename T> using foo = T::type; // ok ```
This is also allowed in previous language versions as an extension, because I think it's pretty useful. :)
Reviewed By: #clang-language-wg, erichkeane
Differential Revision: https://reviews.llvm.org/D53847
show more ...
|
Revision tags: llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2 |
|
#
a6308c0a |
| 17-Jun-2020 |
Richard Smith <richard@metafoo.co.uk> |
When performing a substitution into a dependent alias template, mark the outer levels as retained rather than omitting their arguments.
This better reflects what's going on (we're performing a subst
When performing a substitution into a dependent alias template, mark the outer levels as retained rather than omitting their arguments.
This better reflects what's going on (we're performing a substitution while still inside a template), and in theory is more correct, but I've not found a testcase where it matters in practice (largely because we don't allow alias templates to be declared inside a function).
Fixed AST dumping of SubstNonTypeTemplateParm[Pack]Expr to demonstrate that we're properly substituting through dependent alias templates. (We can't deduce properly through these yet, but we can at least produce the right input to template argument deduction.)
No functionality change intended.
show more ...
|
Revision tags: llvmorg-10.0.1-rc1, llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init |
|
#
907cefe7 |
| 07-Jan-2020 |
Richard Smith <richard@metafoo.co.uk> |
Always deduce the lengths of contained parameter packs when deducing a pack expansion.
Previously, if all parameter / argument pairs for a pack expansion deduction were non-deduced contexts, we woul
Always deduce the lengths of contained parameter packs when deducing a pack expansion.
Previously, if all parameter / argument pairs for a pack expansion deduction were non-deduced contexts, we would not deduce the arity of the pack, and could end up deducing a different arity (leading to failures during substitution) or defaulting to an arity of 0 (leading to bad diagnostics about passing the wrong number of arguments to a variadic function). Instead, we now always deduce the arity for all involved packs any time we deduce a pack expansion.
This will result in less substitution happening in some cases, which could avoid non-SFINAEable errors, and should generally improve the quality of diagnostics when passing initializer lists to variadic functions.
show more ...
|
Revision tags: llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1, llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3, llvmorg-8.0.1-rc2, llvmorg-8.0.1-rc1, llvmorg-8.0.0, llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4, llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2, llvmorg-8.0.0-rc1, llvmorg-7.0.1, llvmorg-7.0.1-rc3, llvmorg-7.0.1-rc2, llvmorg-7.0.1-rc1, llvmorg-7.0.0, llvmorg-7.0.0-rc3, llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1, llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2 |
|
#
ecad88d2 |
| 26-Apr-2018 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Factor out common code for diagnosing missing template arguments.
In passing, add 'concept' to the list of template kinds in diagnostics.
llvm-svn: 330890
|
Revision tags: llvmorg-6.0.1-rc1, llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1, llvmorg-6.0.0, llvmorg-6.0.0-rc3, llvmorg-6.0.0-rc2, llvmorg-6.0.0-rc1, llvmorg-5.0.1, llvmorg-5.0.1-rc3, llvmorg-5.0.1-rc2, llvmorg-5.0.1-rc1, llvmorg-5.0.0, llvmorg-5.0.0-rc5, llvmorg-5.0.0-rc4, llvmorg-5.0.0-rc3, llvmorg-5.0.0-rc2, llvmorg-5.0.0-rc1, llvmorg-4.0.1, llvmorg-4.0.1-rc3, llvmorg-4.0.1-rc2, llvmorg-4.0.1-rc1, llvmorg-4.0.0, llvmorg-4.0.0-rc4, llvmorg-4.0.0-rc3, llvmorg-4.0.0-rc2, llvmorg-4.0.0-rc1 |
|
#
0c062b40 |
| 14-Jan-2017 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Give more accurate descriptions of what kind of template we found in diagnostics.
We were previouly assuming that every type template was a class template, which is not true any more.
llvm-svn: 291
Give more accurate descriptions of what kind of template we found in diagnostics.
We were previouly assuming that every type template was a class template, which is not true any more.
llvm-svn: 291988
show more ...
|
#
32b43764 |
| 08-Jan-2017 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR31514: Add recursive self-instantiation check during template argument deduction in partial ordering.
This prevents us from crashing due to attempting to instantiate the same class template specia
PR31514: Add recursive self-instantiation check during template argument deduction in partial ordering.
This prevents us from crashing due to attempting to instantiate the same class template specialization definition multiple times. (Debug builds also appear to sometimes hit the stack limit before hitting the instantiation depth limit in this case.)
llvm-svn: 291407
show more ...
|
Revision tags: llvmorg-3.9.1, llvmorg-3.9.1-rc3, llvmorg-3.9.1-rc2, llvmorg-3.9.1-rc1 |
|
#
c5452ed9 |
| 19-Oct-2016 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Add optimization to sizeof...(X) handling: if none of parameter pack X's corresponding arguments are unexpanded pack expansions, we can compute the result without substituting them. This significantl
Add optimization to sizeof...(X) handling: if none of parameter pack X's corresponding arguments are unexpanded pack expansions, we can compute the result without substituting them. This significantly improves the memory usage and performance of make_integer_sequence implementations that do this kind of thing:
using result = integer_sequence<T, Ns ..., sizeof...(Ns) + Ns ...>;
... but note that such an implementation will still perform O(sizeof...(Ns)^2) work while building the second pack expansion (we just have a somewhat lower constant now).
In principle we could get this down to linear time by caching whether the number of expansions of a pack is constant, or checking whether we're within an alias template before scanning the pack for pack expansions (since that's the only case in which we do substitutions within a dependent context at the moment), but this patch doesn't attempt that.
llvm-svn: 284653
show more ...
|
Revision tags: llvmorg-3.9.0, llvmorg-3.9.0-rc3, llvmorg-3.9.0-rc2, llvmorg-3.9.0-rc1 |
|
#
3cbf3f1f |
| 15-Jul-2016 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Push alias-declarations and alias-template declarations into scope even if they're redeclarations. This is necessary in order for name lookup to correctly find the most recent declaration of the name
Push alias-declarations and alias-template declarations into scope even if they're redeclarations. This is necessary in order for name lookup to correctly find the most recent declaration of the name (which affects default template argument lookup and cross-module merging, among other things).
llvm-svn: 275612
show more ...
|
Revision tags: llvmorg-3.8.1, llvmorg-3.8.1-rc1, llvmorg-3.8.0, llvmorg-3.8.0-rc3, llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1, llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1 |
|
#
d784e689 |
| 23-Sep-2015 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR14858: Initial support for proper sizeof... handling within alias templates. This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently giv
PR14858: Initial support for proper sizeof... handling within alias templates. This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently give the wrong answers.
llvm-svn: 248431
show more ...
|
Revision tags: llvmorg-3.7.0, llvmorg-3.7.0-rc4, llvmorg-3.7.0-rc3, studio-1.4, llvmorg-3.7.0-rc2, llvmorg-3.7.0-rc1, llvmorg-3.6.2, llvmorg-3.6.2-rc1, llvmorg-3.6.1, llvmorg-3.6.1-rc1, llvmorg-3.5.2, llvmorg-3.5.2-rc1, llvmorg-3.6.0, llvmorg-3.6.0-rc4, llvmorg-3.6.0-rc3, llvmorg-3.6.0-rc2, llvmorg-3.6.0-rc1, llvmorg-3.5.1, llvmorg-3.5.1-rc2, llvmorg-3.5.1-rc1, llvmorg-3.5.0, llvmorg-3.5.0-rc4, llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2, llvmorg-3.5.0-rc1, llvmorg-3.4.2, llvmorg-3.4.2-rc1, llvmorg-3.4.1, llvmorg-3.4.1-rc2, llvmorg-3.4.1-rc1, llvmorg-3.4.0, llvmorg-3.4.0-rc3, llvmorg-3.4.0-rc2, llvmorg-3.4.0-rc1 |
|
#
2a1d9a92 |
| 15-Aug-2013 |
Eli Friedman <eli.friedman@gmail.com> |
Fix for dependent contexts in alias templates.
When we are parsing a type for an alias template, we are not entering the context, so we can't look into dependent classes. Make sure the parser handl
Fix for dependent contexts in alias templates.
When we are parsing a type for an alias template, we are not entering the context, so we can't look into dependent classes. Make sure the parser handles this correctly.
PR16904.
llvm-svn: 188510
show more ...
|
#
98b20f12 |
| 19-Jul-2013 |
Larisse Voufo <lvoufo@google.com> |
FIXME fix: improving diagnostics for template arguments deduction of class templates and explicit specializations This patch essentially removes all the FIXMEs following calls to DeduceTemplateAr
FIXME fix: improving diagnostics for template arguments deduction of class templates and explicit specializations This patch essentially removes all the FIXMEs following calls to DeduceTemplateArguments() that want to keep track of deduction failure info.
llvm-svn: 186730
show more ...
|
#
fa163749 |
| 19-Jul-2013 |
Eli Friedman <eli.friedman@gmail.com> |
Fix pack instantiation with function types.
Make sure we correctly expand packs which expand to another pack in a function type.
llvm-svn: 186728
|
#
8917ad5d |
| 19-Jul-2013 |
Eli Friedman <eli.friedman@gmail.com> |
Fix for template substitution with packs.
When we see a pack, and replace it with a template argument which is also a pack, we want to use the pack pattern, not the expanded pack. The caller should
Fix for template substitution with packs.
When we see a pack, and replace it with a template argument which is also a pack, we want to use the pack pattern, not the expanded pack. The caller should take care of expanding the pack afterwards.
Fixes PR16646.
llvm-svn: 186713
show more ...
|
Revision tags: llvmorg-3.3.1-rc1, llvmorg-3.3.0, llvmorg-3.3.0-rc3, llvmorg-3.3.0-rc2, llvmorg-3.3.0-rc1, llvmorg-3.2.0, llvmorg-3.2.0-rc3, llvmorg-3.2.0-rc2, llvmorg-3.2.0-rc1 |
|
#
3beb930c |
| 16-Jul-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
More for PR11848: a pack expansion type isn't necessarily type-dependent (its pattern might be an alias template which doesn't use its arguments). It's always instantiation-dependent, though.
llvm-s
More for PR11848: a pack expansion type isn't necessarily type-dependent (its pattern might be an alias template which doesn't use its arguments). It's always instantiation-dependent, though.
llvm-svn: 160246
show more ...
|
#
68eea507 |
| 16-Jul-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Related to PR11848 and core-21989: switch ContainsUnexpandedParameterPack from being a property of a canonical type to being a property of the fully-sugared type. This should only make a difference i
Related to PR11848 and core-21989: switch ContainsUnexpandedParameterPack from being a property of a canonical type to being a property of the fully-sugared type. This should only make a difference in the case where an alias template ignores one of its parameters, and that parameter is an unexpanded parameter pack.
llvm-svn: 160244
show more ...
|
#
34349003 |
| 09-Jul-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR13136:
* When substituting a reference to a non-type template parameter pack where the corresponding argument is a pack expansion, transform into an expression which contains an unexpanded
PR13136:
* When substituting a reference to a non-type template parameter pack where the corresponding argument is a pack expansion, transform into an expression which contains an unexpanded parameter pack rather than into an expression which contains a pack expansion. This causes the SubstNonTypeTemplateParmExpr to be inside the PackExpansionExpr, rather than outside, so the expression still looks like a pack expansion and can be deduced.
* Teach MarkUsedTemplateParameters that we can deduce a reference to a template parameter if it's wrapped in a SubstNonTypeTemplateParmExpr (such nodes are added during alias template substitution).
llvm-svn: 159922
show more ...
|
#
7ebb07c8 |
| 08-Jul-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR13243: When deducing a non-type template parameter which is specified as an expression, skip over any SubstNonTypeTemplateParmExprs which alias templates may have inserted before checking for a Dec
PR13243: When deducing a non-type template parameter which is specified as an expression, skip over any SubstNonTypeTemplateParmExprs which alias templates may have inserted before checking for a DeclRefExpr referring to a non-type template parameter declaration.
llvm-svn: 159909
show more ...
|
Revision tags: llvmorg-3.1.0, llvmorg-3.1.0-rc3, llvmorg-3.1.0-rc2, llvmorg-3.1.0-rc1 |
|
#
0dd22bc4 |
| 25-Jan-2012 |
Douglas Gregor <dgregor@apple.com> |
When we're substituting into a function parameter pack and expect to get a function parameter pack (but don't due to weird substitutions), complain. Fixes the last bit of PR11848.
llvm-svn: 148960
|
#
928be491 |
| 25-Jan-2012 |
Richard Smith <richard-llvm@metafoo.co.uk> |
Fix PR11848: decree that an alias template contains an unexpanded parameter pack iff its substitution contains an unexpanded parameter pack. This has the effect that we now reject declarations such a
Fix PR11848: decree that an alias template contains an unexpanded parameter pack iff its substitution contains an unexpanded parameter pack. This has the effect that we now reject declarations such as this (which we used to crash when expanding):
template<typename T> using Int = int; template<typename ...Ts> void f(Int<Ts> ...ints);
The standard is inconsistent on how this case should be treated.
llvm-svn: 148905
show more ...
|
Revision tags: llvmorg-3.0.0, llvmorg-3.0.0-rc4, llvmorg-3.0.0-rc3, llvmorg-3.0.0-rc2, llvmorg-3.0.0-rc1 |
|
#
9ca5c425 |
| 13-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!
llvm-svn: 141900
|
#
0c4a34b1 |
| 14-May-2011 |
Richard Smith <richard-llvm@metafoo.co.uk> |
PR9908: Fix the broken fix for PR9902 to get the template argument lists in the right order. Also, don't reject alias templates in all ElaboratedTypes: some ElaboratedTypes do not correspond to elabo
PR9908: Fix the broken fix for PR9902 to get the template argument lists in the right order. Also, don't reject alias templates in all ElaboratedTypes: some ElaboratedTypes do not correspond to elaborated-type-specifiers.
llvm-svn: 131342
show more ...
|