| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
resolution require that the pointed-to type be an object type, but we
weren't filtering out non-object types. Do so, fixing PR7851.
llvm-svn: 122853
|
|
|
|
|
|
|
|
|
|
| |
conversions on the substituted non-type template arguments of a class
template partial specialization. C++ [temp.class.spec]p8 actually
prohibits all of the cases where this code would have fired.
Hey, it's better than having to deal with variadic templates here!
llvm-svn: 122852
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 122851
|
|
|
|
| |
llvm-svn: 122848
|
|
|
|
|
|
| |
variadic templates. No functionality change.
llvm-svn: 122847
|
|
|
|
|
|
| |
argument packs when finishing template argument deduction for a function template
llvm-svn: 122843
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 122751
|
|
|
|
|
|
|
|
| |
caused an assertion when dealing with non-type template parameter
packs. Add some tests for deduction and instantiation of non-type
template parameter packs.
llvm-svn: 122534
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 122463
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 122461
|
|
|
|
| |
llvm-svn: 122454
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 122452
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 122439
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 122425
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 122418
|
|
|
|
|
|
|
| |
area of printing template arguments. The functionality changes here
are limited to cases of variadic templates that aren't yet enabled.
llvm-svn: 122250
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pack expansions, e.g. given
template<typename... Types> struct tuple;
template<typename... Types>
struct tuple_of_refs {
typedef tuple<Types&...> types;
};
the type of the "types" typedef is a PackExpansionType whose pattern
is Types&.
This commit introduces support for creating pack expansions for
template type arguments, as above, but not for any other kind of pack
expansion, nor for any form of instantiation.
llvm-svn: 122223
|
|
|
|
|
|
|
|
|
|
| |
space better. Remove this reference. To make that work, change some APIs
(most importantly, getDesugaredType()) to take an ASTContext& if they
need to return a QualType. Simultaneously, diminish the need to return a
QualType by introducing some useful APIs on SplitQualType, which is
just a std::pair<const Type *, Qualifiers>.
llvm-svn: 121478
|
|
|
|
|
|
|
|
| |
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method
trunc(), to be const and to return a new value instead of modifying the
object in place.
llvm-svn: 121121
|
|
|
|
| |
llvm-svn: 120084
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 119145
|
|
|
|
|
|
| |
function templates. Fixes PR8130.
llvm-svn: 118944
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.
But don't get too excited about that happening now.
llvm-svn: 118385
|
|
|
|
|
|
| |
make sure to setup the instantiation stack. Fixes rdar://8620775 & http://llvm.org/PR8234
llvm-svn: 118314
|
|
|
|
|
|
|
| |
only keep deduction results for successful deductions, so that they
can be compared against each other. Fixes PR8462, from Richard Smith!
llvm-svn: 117983
|
|
|
|
|
|
| |
anymore.
llvm-svn: 117357
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 116373
|
|
|
|
|
|
|
| |
deduction and the final substitution, but not while substituting the
explicit template arguments. Fixes rdar://problem/8537391
llvm-svn: 116332
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 116327
|
|
|
|
|
|
|
|
| |
against a function type, be sure to check the type of the resulting
function template specialization against the desired function type
after substituting the deduced/defaulted template arguments. Fixes PR8196.
llvm-svn: 115086
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 112523
|
|
|
|
|
|
|
| |
properly account for the possibility that certain opaque types
might be more qualified than they appear. Fixes PR7708.
llvm-svn: 112390
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
an '&' expression from the second caller of ActOnIdExpression.
Teach template argument deduction that an overloaded id-expression
doesn't give a valid type for deduction purposes to a non-static
member function unless the expression has the correct syntactic
form.
Teach ActOnIdExpression that it shouldn't try to create implicit
member expressions for '&function', because this isn't a
permitted form of use for member functions.
Teach CheckAddressOfOperand to diagnose these more carefully.
Some of these cases aren't reachable right now because earlier
diagnostics interrupt them.
llvm-svn: 112258
|
|
|
|
| |
llvm-svn: 112026
|
|
|
|
| |
llvm-svn: 111904
|
|
|
|
|
|
|
|
|
| |
- move DeclSpec &c into the Sema library
- move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.
llvm-svn: 111667
|
|
|
|
|
|
| |
the context allows us to ignore qualifiers on the array type itself.
llvm-svn: 111486
|
|
|
|
| |
llvm-svn: 110945
|
|
|
|
|
|
|
|
| |
a template-argument-list. When template template parameters are
involved, we won't already have checked the template-argument-list (it
may not be known yet!). Fixes PR7807.
llvm-svn: 110444
|
|
|
|
|
|
|
| |
Rename it to TDK_Underqualified to avoid this sort of confusion and give it
its own diagnostic.
llvm-svn: 110318
|
|
|
|
|
|
| |
pointers like it can with normal and member pointers.
llvm-svn: 110313
|
|
|
|
| |
llvm-svn: 110304
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
case of an elaborated-type-specifier like 'typename A<T>::foo', and
DependentTemplateSpecializationType represents the case of an
elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc
representation of a DependentTST conveniently exactly matches that of an
ElaboratedType wrapping a TST.
Kill off the explicit rebuild methods for RebuildInCurrentInstantiation;
the standard implementations work fine because the nested name specifier
is computable in the newly-entered context.
llvm-svn: 105801
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ObjCObjectType, which is basically just a pair of
one of {primitive-id, primitive-Class, user-defined @class}
with
a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared). ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.
Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet. Remove some number of methods that are no
longer used, at least after this patch.
By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.
llvm-svn: 103870
|
|
|
|
|
|
| |
against pointer patterns.
llvm-svn: 103706
|
|
|
|
|
|
| |
substitute explicit template arguments into a function template
llvm-svn: 103369
|
|
|
|
|
|
|
|
|
|
|
| |
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 ...
^
llvm-svn: 103348
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
failed because the explicitly-specified template arguments did not
match its template parameters, e.g.,
test/SemaTemplate/overload-candidates.cpp:18:8: note: candidate
template
ignored: invalid explicitly-specified argument for template
parameter 'I'
void get(const T&);
^
test/SemaTemplate/overload-candidates.cpp:20:8: note: candidate
template
ignored: invalid explicitly-specified argument for 1st template
parameter
void get(const T&);
^
llvm-svn: 103344
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 102601
|
|
|
|
|
|
|
| |
specializations, separate out the deduction part from the checking and
substitution of the deduced arguments.
llvm-svn: 102600
|