| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
(C++ [temp.func.order]).
llvm-svn: 81777
|
|
|
|
| |
llvm-svn: 81346
|
|
|
|
|
|
|
|
|
|
| |
to a multi-level template argument list by making it explicit. The
forced auditing of callers found a bug in the instantiation of member
classes inside member templates.
I *love* static type systems.
llvm-svn: 80391
|
|
|
|
|
|
| |
functions that don't instantiate definitions.
llvm-svn: 80037
|
|
|
|
|
|
|
| |
template argument deduction from a conversion function (C++
[temp.deduct.conv]) with implicit conversions.
llvm-svn: 79693
|
|
|
|
| |
llvm-svn: 78452
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()
And remove Type::getAsReferenceType(), etc.
This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.
llvm-svn: 77510
|
|
|
|
|
|
|
|
| |
real. It turns out that we need to actually move all of the qualifiers
up to the array type itself, then recanonicalize the deduced template
argument type.
llvm-svn: 76788
|
|
|
|
| |
llvm-svn: 76777
|
|
|
|
|
|
|
|
|
|
| |
const T
can be matched with, e.g.,
volatile int [5]
llvm-svn: 76773
|
|
|
|
| |
llvm-svn: 76321
|
|
|
|
|
|
| |
place.
llvm-svn: 76274
|
|
|
|
|
|
|
|
|
| |
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.
llvm-svn: 76193
|
|
|
|
|
|
| |
Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.
llvm-svn: 76139
|
|
|
|
| |
llvm-svn: 76132
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.
The motivation behind this change is twofold:
1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.
2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.
Along with this patch:
a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.
llvm-svn: 76098
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 75044
|
|
|
|
| |
llvm-svn: 74966
|
|
|
|
|
|
|
|
| |
implement C++ [temp.deduct.call]p3b3, which allows a template-id
parameter to match a derived class of the argument, while deducing
template arguments.
llvm-svn: 74965
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 74651
|
|
|
|
|
|
|
| |
are fewer template arguments than there are template parameters for
that function.
llvm-svn: 74578
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 74576
|
|
|
|
|
|
|
| |
redundant, implicit instantiations of function templates and provide a
place where we can hang function template specializations.
llvm-svn: 74454
|
|
|
|
|
|
|
| |
deduction using a base class of the argument type. No actual
functionality change; this is just a hook.
llvm-svn: 74356
|
|
|
|
|
|
|
|
| |
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).
llvm-svn: 74354
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 74323
|
|
|
|
|
|
|
| |
deducing template arguments from a function call. Plus, add a bunch of
tests.
llvm-svn: 74301
|
|
|
|
|
|
|
|
|
| |
For a FunctionDecl that has been instantiated due to template argument
deduction, we now store the primary template from which it was
instantiated and the deduced template arguments. From this
information, we can instantiate the body of the function template.
llvm-svn: 74232
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 74213
|
|
|
|
|
|
| |
variadic templates.
llvm-svn: 73937
|
|
|
|
| |
llvm-svn: 73713
|
|
|
|
|
|
|
|
|
|
|
|
| |
representation.
Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).
This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types).
No functionality change.
llvm-svn: 73649
|
|
|
|
|
|
| |
thereof. Patch by Anders Johnsen!
llvm-svn: 73641
|
|
|
|
|
|
| |
an extra pass to set the right APSInt bit width/signedness.
llvm-svn: 73580
|
|
|
|
| |
llvm-svn: 73574
|
|
|
|
| |
llvm-svn: 73391
|
|
|
|
|
|
|
|
|
|
| |
that were suppressed due to SFINAE. By checking whether any errors
occur at the end of template argument deduction, we avoid the
possibility of suppressing an error (due to SFINAE) and then
recovering so well that template argument deduction never detects that
there was a problem. Thanks to Eli for the push in this direction.
llvm-svn: 73336
|
|
|
|
|
|
| |
obviously written by someone who didn't read C++ [temp.class.spec].
llvm-svn: 73276
|
|
|
|
|
|
|
| |
specialization cannot be deduced, produce a warning noting that the
affected class template partial specialization will never be used.
llvm-svn: 73274
|
|
|
|
|
|
| |
use it.
llvm-svn: 73264
|
|
|
|
|
|
| |
specializations; add comments and update the C++ status page
llvm-svn: 73263
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
argument deduction failed. For example, given
template<typename T> struct is_same<T, T> { ... };
template argument deduction will fail for is_same<int, float>, and now
reports enough information
Right now, we don't do anything with this extra information, but it
can be used for informative diagnostics that say, e.g., "template
argument deduction failed because T was deduced to 'int' in one
context and 'float' in another".
llvm-svn: 73237
|
|
|
|
| |
llvm-svn: 73232
|
|
|
|
|
|
|
|
|
|
|
|
| |
partial specialization, substitute those template arguments back into
the template arguments of the class template partial specialization to
see if the results still match the original template arguments.
This code is more general than it needs to be, since we don't yet
diagnose C++ [temp.class.spec]p9. However, it's likely to be needed
for function templates.
llvm-svn: 73196
|
|
|
|
|
|
|
| |
Also, introduced some of the framework for performing instantiation as
part of template argument deduction.
llvm-svn: 73175
|
|
|
|
|
|
|
|
| |
specialization types. As the example shows, we can now compute the
length of a type-list using a template metaprogram and class template
partial specialization.
llvm-svn: 73136
|
|
|
|
| |
llvm-svn: 73077
|
|
|
|
| |
llvm-svn: 73071
|
|
|
|
| |
llvm-svn: 73070
|
|
|
|
|
|
| |
going to need it later). Move push_back to the .cpp file. If the passed in template argument is a type, assert that it's canonical.
llvm-svn: 72918
|