Home | History | Annotate | Download | only in Sema

Lines Matching refs:Deduced

140                         SmallVectorImpl<DeducedTemplateArgument> &Deduced);
149 Deduced,
159 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
169 llvm::SmallBitVector &Deduced);
220 /// Verify that the given, deduced template arguments are compatible.
222 /// \returns The deduced template argument, or a NULL template argument if
223 /// the deduced template arguments were incompatible.
234 // If we have two non-type template argument values deduced for the same
237 // for that now. The exception is that if either was deduced from an array
250 llvm_unreachable("Non-deduced template arguments handled above");
258 // If one of the two arguments was deduced from an array bound, the other
267 // If we deduced a constant in one case and either a dependent expression or
314 // If we deduced a declaration and a dependent expression, keep the
319 // If we deduced a declaration and an integral constant, keep the
329 // If we deduced two declarations, make sure that they refer to the
339 // If we deduced a null pointer and a dependent expression, keep the
344 // If we deduced a null pointer and an integral constant, keep the
349 // If we deduced two null pointers, they are the same.
384 /// as the given deduced template argument. All non-type template parameter
390 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
395 S.Context, Deduced[NTTP->getIndex()], NewDeduced);
398 Info.FirstArg = Deduced[NTTP->getIndex()];
403 Deduced[NTTP->getIndex()] = Result;
432 S, TemplateParams, ParamType, ValueType, Info, Deduced,
443 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
448 ValueType, Info, Deduced);
457 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
467 Value->getType(), Info, Deduced);
477 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
480 Value->getType(), Info, Deduced);
491 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
495 S, TemplateParams, NTTP, DeducedTemplateArgument(New), T, Info, Deduced);
504 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
520 Deduced[TempParam->getIndex()],
524 Info.FirstArg = Deduced[TempParam->getIndex()];
529 Deduced[TempParam->getIndex()] = Result;
556 /// \param Deduced the deduced template arguments
567 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
582 Info, Deduced))
591 SpecArg->template_arguments(), Info, Deduced,
619 Info, Deduced))
625 Deduced, /*NumberOfArgumentsMustMatch=*/true);
672 // deduced because this deduction hadn't happened yet.
691 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
693 : S(S), TemplateParams(TemplateParams), Deduced(Deduced), Info(Info) {
700 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
702 : S(S), TemplateParams(TemplateParams), Deduced(Deduced), Info(Info) {
709 // Save the deduced template argument for the parameter pack expanded
712 Pack.Saved = Deduced[Index];
713 Deduced[Index] = TemplateArgument();
738 // packs appearing in that parameter to have the same deduced arity. Also,
740 // type, so we need to collect the pending deduced values for those packs.
768 // Also look for unexpanded packs that are indirectly deduced by deducing
819 // We pre-populate the deduced value of the partially-substituted
821 // value is supposed to have been substituted, not deduced, but the
828 Deduced[Pack.Index] = Pack.New[PackElements];
855 /// Move to deducing the next element in each pack that is being deduced.
857 // Capture the deduced template arguments for each parameter pack expanded
858 // by this pack expansion, add them to the list of arguments we've deduced
859 // for that pack, then clear out the deduced argument.
861 DeducedTemplateArgument &DeducedArg = Deduced[Pack.Index];
885 Deduced[Pack.Index] = Pack.Saved;
905 // If we deduced an empty argument pack, create it now.
914 // deduced from an array bound and others are not:
932 Loc = &Deduced[Pack.Index];
974 SmallVectorImpl<DeducedTemplateArgument> &Deduced;
1004 /// \param Deduced the deduced template arguments
1022 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
1053 Info, Deduced, TDF,
1069 PackDeductionScope PackScope(S, TemplateParams, Deduced, Info, Pattern);
1072 // a non-deduced context.
1078 Args[ArgIdx], Info, Deduced,
1086 // The non-deduced contexts are:
1097 // entire template-argument-list a non-deduced context.
1125 /// a deduced set of qualifiers to the ParamType that would result in
1219 /// \param Deduced the deduced template arguments.
1227 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
1230 // transformed A can be a derived class of the deduced A. Likewise if
1233 // deduced A. However, if there is a class C that is a (direct or
1235 // class B and that would be a valid deduced A, the deduced A cannot be
1239 // otherwise fail. If they yield more than one possible deduced A, the
1273 SmallVector<DeducedTemplateArgument, 8> DeducedCopy(Deduced.begin(),
1274 Deduced.end());
1316 std::swap(Matches.front().second, Deduced);
1333 /// \param Deduced the deduced template arguments
1349 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
1423 // - If the original P is a reference type, the deduced A (i.e., the type
1445 // deduced as X&. - end note ]
1454 // template non-type argument i can be deduced if P and A have one of
1502 // Remove any qualifiers on the parameter from the deduced type.
1541 Deduced[Index],
1545 Info.FirstArg = Deduced[Index];
1550 Deduced[Index] = Result;
1575 // than the deduced A
1656 Info, Deduced, TDF);
1666 Info, Deduced, TDF);
1686 Info, Deduced, SubTDF);
1698 ReferenceArg->getPointeeType(), Info, Deduced, 0);
1711 Info, Deduced, 0);
1725 Info, Deduced, SubTDF);
1744 Info, Deduced, SubTDF);
1762 Info, Deduced, SubTDF))
1781 Info, Deduced);
1788 Info, Deduced);
1817 FunctionProtoArg->getReturnType(), Info, Deduced, 0))
1825 FunctionProtoArg->getNumParams(), Info, Deduced, SubTDF))
1848 // We give E in noexcept(E) the "deduced from array bound" treatment.
1852 /*ArrayBound*/true, Info, Deduced);
1857 S, TemplateParams, NTTP, ArgNoexceptExpr, Info, Deduced);
1862 // FIXME: Detect non-deduced exception specification mismatches?
1893 Deduced);
1895 SmallVector<DeducedTemplateArgument, 8> DeducedOrig(Deduced.begin(),
1896 Deduced.end());
1899 S, TemplateParams, SpecParam, Arg, Info, Deduced);
1910 // Reset the incorrectly deduced argument from above.
1911 Deduced = DeducedOrig;
1915 S, RecordT, TemplateParams, SpecParam, Info, Deduced);
1950 Info, Deduced,
1957 Info, Deduced,
1976 Info, Deduced, 0);
1993 Info, Deduced, TDF);
2006 Info, Deduced, TDF);
2020 VectorArg->getElementType(), Info, Deduced, TDF))
2036 Info, Deduced);
2044 VectorArg->getElementType(), Info, Deduced, TDF))
2054 S, TemplateParams, NTTP, VectorArg->getSizeExpr(), Info, Deduced);
2073 Info, Deduced, TDF))
2089 Deduced);
2099 Info, Deduced, TDF))
2110 Info, Deduced);
2134 MatrixArg->getElementType(), Info, Deduced, TDF);
2148 MatrixArg->getElementType(), Info, Deduced, TDF))
2153 [&S, &Info, &Deduced, &TemplateParams](
2191 /*ArrayBound=*/true, Info, Deduced);
2196 Info, Deduced);
2223 AddressSpaceArg->getPointeeType(), Info, Deduced, TDF))
2234 Deduced);
2246 S.Context.removeAddrSpaceQualType(Arg), Info, Deduced, TDF))
2257 true, Info, Deduced);
2279 Deduced);
2314 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
2330 Info, Deduced, 0);
2339 Arg.getAsTemplate(), Info, Deduced);
2393 Info, Deduced);
2397 Info, Deduced);
2400 Arg.getAsExpr(), Info, Deduced);
2405 Info, Deduced);
2470 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
2475 // non-deduced context.
2504 Info, Deduced))
2522 PackDeductionScope PackScope(S, TemplateParams, Deduced, Info, Pattern);
2524 // Keep track of the deduced template arguments for each parameter pack
2533 Info, Deduced))
2554 SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
2556 ArgList.asArray(), Info, Deduced,
2565 // If we're checking deduced arguments (X) against original arguments (Y),
2703 /// Convert the given deduced template argument and add it to the set of
2714 // Convert the deduced template argument into a template
2735 // When converting the deduced template argument, append it to the
2741 "deduced nested pack");
2743 // We deduced arguments for some elements of this pack, but not for
2744 // all of them. This happens if we get a conditionally-non-deduced
2799 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
2809 // A trailing template parameter pack (14.5.3) not otherwise deduced will
2810 // be deduced to an empty sequence of template arguments.
2812 if (Deduced[I].isNull() && Param->isTemplateParameterPack()) {
2814 PackDeductionScope(S, TemplateParams, Deduced, Info, I).finish())
2818 if (!Deduced[I].isNull()) {
2822 // via additional deduced arguments).
2834 Builder.push_back(Deduced[I]);
2839 // We may have deduced this argument, so it still needs to be
2841 if (ConvertDeducedTemplateArgument(S, Param, Deduced[I], Template, Info,
2935 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
2945 // [...] or if any template argument remains neither deduced nor
2949 S, Partial, IsPartialOrdering, Deduced, Info, Builder))
2952 // Form the template argument list from the deduced template arguments.
2958 // Substitute the deduced template arguments into the template
3021 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
3031 // [...] or if any template argument remains neither deduced nor
3035 S, Template, /*IsDeduced*/PartialOrdering, Deduced, Info, Builder))
3074 // specialization can be deduced from the actual template argument
3086 SmallVector<DeducedTemplateArgument, 4> Deduced;
3087 Deduced.resize(Partial->getTemplateParameters()->size());
3092 TemplateArgs, Info, Deduced))
3095 SmallVector<TemplateArgument, 4> DeducedArgs(Deduced.begin(), Deduced.end());
3108 TemplateArgs, Deduced, Info);
3126 // specialization can be deduced from the actual template argument
3138 SmallVector<DeducedTemplateArgument, 4> Deduced;
3139 Deduced.resize(Partial->getTemplateParameters()->size());
3142 TemplateArgs, Info, Deduced))
3145 SmallVector<TemplateArgument, 4> DeducedArgs(Deduced.begin(), Deduced.end());
3158 TemplateArgs, Deduced, Info);
3192 /// \param Deduced the deduced template arguments, which will be populated
3211 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
3274 // If we deduced template arguments for a template parameter pack,
3381 // Trailing template arguments that can be deduced (14.8.2) may be
3383 // template arguments can be deduced, they may all be omitted; in this
3387 // the set of deduced template arguments. The partially-substituted
3390 Deduced.reserve(TemplateParams->size());
3394 Deduced.push_back(DeducedTemplateArgument());
3396 Deduced.push_back(Arg);
3402 /// Check whether the deduced argument type for a call to a function
3434 // - If the original P is a reference type, the deduced A (i.e., the
3444 // the deduced A can be F.
3452 // Under Objective-C++ ARC, the deduced type may have implicitly
3470 // deduced argument type's qualifiers as if we had performed the
3477 // type that can be converted to the deduced A via a function pointer
3491 // transformed A can be a derived class of the deduced A. [...]
3494 // derived class pointed to by the deduced A.
3549 /// checking the deduced template arguments for completeness and forming
3553 /// which the deduced argument types should be compared.
3556 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
3568 SmallVector<TemplateArgument, 4> DeducedArgs(Deduced.begin(), Deduced.end());
3578 // [...] or if any template argument remains neither deduced nor
3582 *this, FunctionTemplate, /*IsDeduced*/true, Deduced, Info, Builder,
3590 // and all template arguments are explicitly specified, deduced, or
3599 // Form the template argument list from the deduced template arguments.
3604 // Substitute the deduced template arguments into the function template
3633 // [...] When all template arguments have been deduced [...] all uses of
3634 // template parameters [...] are replaced with the corresponding deduced
3655 // values that will make the deduced A identical to A (after the type A
3676 // deduced A.
3790 // non-deduced context.
3819 // treated as a non-deduced context.
3823 // the deduced template argument values are then combined.
3826 Deduced(TemplateParams->size());
3830 ArgType, Info, Deduced, TDF);
3908 // values that will make the deduced A identical to A (after the type A
3912 // - If the original P is a reference type, the deduced A (i.e., the
3918 // type that can be converted to the deduced A via a qualification
3924 // transformed A can be a derived class of the deduced A. Likewise,
3927 // the deduced A.
3944 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
3953 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
3973 // considered a non-deduced context
3978 // a non-deduced context.
3987 S, TemplateParams, 0, ElTy, E, Info, Deduced, OriginalCallArgs, true,
3993 // in the P0[N] case, if N is a non-type template parameter, N is deduced
4007 /*ArrayBound=*/true, Info, Deduced))
4020 SmallVectorImpl<DeducedTemplateArgument> &Deduced,
4035 Deduced, OriginalCallArgs, ArgIdx, TDF);
4038 // that will make the deduced A identical to A
4041 // so we can check for compatibility between the deduced A and A.
4045 ArgType, Info, Deduced, TDF);
4106 SmallVector<DeducedTemplateArgument, 4> Deduced;
4113 FunctionTemplate, *ExplicitTemplateArgs, Deduced, ParamTypes, nullptr,
4119 NumExplicitlySpecified = Deduced.size();
4139 *this, TemplateParams, FirstInnerIndex, ParamType, Args[ArgIdx], Info, Deduced,
4144 Deduced.resize(TemplateParams->size());
4165 PackDeductionScope PackScope(*this, TemplateParams, Deduced, Info,
4175 // in a non-deduced context [not at the end of the list], the type of
4176 // that parameter pack is never deduced.
4179 // after we skip it (in the non-deduced case). That makes no sense, so
4183 // non-deduced context.
4220 FunctionTemplate, Deduced, NumExplicitlySpecified, Specialization, Info,
4308 SmallVector<DeducedTemplateArgument, 4> Deduced;
4315 FunctionTemplate, *ExplicitTemplateArgs, Deduced, ParamTypes,
4321 Deduced.size();
4336 Deduced.resize(TemplateParams->size());
4338 // If the function has a deduced return type, substitute it for a dependent
4339 // type so that we treat it as a non-deduced context in what follows. If we
4340 // are looking up by signature, the signature type should also have a deduced
4356 Info, Deduced, TDF))
4362 Result = FinishTemplateArgumentDeduction(FunctionTemplate, Deduced,
4369 // If the function has a deduced return type, deduce it now, so we can check
4370 // that the deduced function type matches the requested type.
4491 SmallVector<DeducedTemplateArgument, 4> Deduced;
4492 Deduced.resize(TemplateParams->size());
4496 // argument values that will make the deduced A identical to
4500 // cv-qualified than the deduced A (i.e., the type referred to
4504 // - The deduced A can be another pointer or pointer to member
4516 P, A, Info, Deduced, TDF))
4525 Result = FinishTemplateArgumentDeduction(ConversionTemplate, Deduced, 0,
4569 /// Substitute the 'auto' specifier or deduced template specialization type
4604 // auto type deduced as T" in order for [temp.deduct.call]p3 to apply.
4683 AutoTypeLoc TypeLoc, QualType Deduced) {
4689 TemplateArgumentLoc(TemplateArgument(Deduced),
4691 Deduced, TypeLoc.getNameLoc())));
4716 << Deduced << Buf << TypeLoc.getLocalSourceRange();
4730 /// \param Init the initializer for the variable whose type is to be deduced.
4732 /// deduced type.
4737 /// \param IgnoreConstraints Set if we should not fail if the deduced type does
4780 QualType Deduced = BuildDecltypeType(Init, Init->getBeginLoc(), false);
4781 if (Deduced.isNull())
4783 // FIXME: Support a non-canonical deduced type for 'auto'.
4784 Deduced = Context.getCanonicalType(Deduced);
4789 Deduced);
4793 Result = SubstituteDeducedTypeTransform(*this, Deduced).Apply(Type);
4825 SmallVector<DeducedTemplateArgument, 1> Deduced;
4826 Deduced.resize(1);
4856 // a non-deduced context.
4867 Info, Deduced, OriginalCallArgs, /*Decomposed*/ true,
4873 Deduced[0].getKind() != TemplateArgument::Null)
4883 *this, TemplateParamsSt.get(), 0, FuncParam, Init, Info, Deduced,
4888 // Could be null if somehow 'auto' appears in a non-deduced context.
4889 if (Deduced[0].getKind() != TemplateArgument::Type)
4892 QualType DeducedType = Deduced[0].getAsType();
4915 // Check that the deduced argument type is compatible with the original
4917 QualType DeducedA = InitList ? Deduced[0].getAsType() : Result;
5085 SmallVector<DeducedTemplateArgument, 4> Deduced;
5086 Deduced.resize(TemplateParams->size());
5149 Args1.data(), Args1.size(), Info, Deduced,
5161 Info, Deduced, TDF_None,
5171 Info, Deduced, TDF_None,
5182 // in a non-deduced context is considered used. -end note]
5183 unsigned ArgIdx = 0, NumArgs = Deduced.size();
5185 if (Deduced[ArgIdx].isNull())
5189 // to substitute the deduced arguments back into the template and check that
5193 // All template arguments were deduced. FT1 is at least as specialized
5221 // If this argument had no value deduced but was used in one of the types
5223 if (Deduced[ArgIdx].isNull() && UsedParameters[ArgIdx])
5463 SmallVector<DeducedTemplateArgument, 4> Deduced;
5466 Deduced.resize(P2->getTemplateParameters()->size());
5468 T2, T1, Info, Deduced, TDF_None,
5472 SmallVector<TemplateArgument, 4> DeducedArgs(Deduced.begin(),
5473 Deduced.end());
5486 Deduced, Info);
5756 // In C++17 mode, additional arguments may be deduced from the type of a
5928 // The non-deduced contexts are: [...]
5937 // When a function parameter pack appears in a non-deduced context,
5938 // the type of that pack is never deduced.
5940 // We should also track a set of "never deduced" parameters, and
5941 // subtract that from the list of deduced parameters after marking.
5980 // non-deduced context.
6014 // The non-deduced contexts are:
6019 // When a type name is specified in a way that includes a non-deduced
6021 // non-deduced.
6149 /// \param E the expression from which template parameters will be deduced.
6153 /// deduced.
6161 /// Mark which template parameters can be deduced from a given
6165 /// parameters will be deduced.
6169 /// deduced.
6177 // non-deduced context.
6187 /// Marks all of the template parameters that will be deduced by a
6191 llvm::SmallBitVector &Deduced) {
6194 Deduced.clear();
6195 Deduced.resize(TemplateParams->size());
6200 true, TemplateParams->getDepth(), Deduced);
6211 llvm::SmallBitVector Deduced(TemplateParams->size());
6213 Deduced);
6215 return Deduced.any();