From 6dc3bcd00170efb78fa8ee5ece1b9b4dbe3f67bd Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 28 Jul 2014 00:02:09 +0000 Subject: [PATCH] Wrap to 80 columns. No behavior change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214059 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaTemplateDeduction.cpp | 43 +++++++++++++++------------- lib/Sema/SemaTemplateInstantiate.cpp | 6 ++-- lib/Sema/TreeTransform.h | 25 +++++++--------- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index 53a75d227c..5d543e9e75 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -1302,7 +1302,8 @@ DeduceTemplateArgumentsByTypeMatch(Sema &S, // T & case Type::LValueReference: { - const LValueReferenceType *ReferenceArg = Arg->getAs(); + const LValueReferenceType *ReferenceArg = + Arg->getAs(); if (!ReferenceArg) return Sema::TDK_NonDeducedMismatch; @@ -1313,7 +1314,8 @@ DeduceTemplateArgumentsByTypeMatch(Sema &S, // T && [C++0x] case Type::RValueReference: { - const RValueReferenceType *ReferenceArg = Arg->getAs(); + const RValueReferenceType *ReferenceArg = + Arg->getAs(); if (!ReferenceArg) return Sema::TDK_NonDeducedMismatch; @@ -2056,7 +2058,8 @@ getTrivialTemplateArgumentLoc(Sema &S, TemplateName Template = Arg.getAsTemplate(); if (DependentTemplateName *DTN = Template.getAsDependentTemplateName()) Builder.MakeTrivial(S.Context, DTN->getQualifier(), Loc); - else if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) + else if (QualifiedTemplateName *QTN = + Template.getAsQualifiedTemplateName()) Builder.MakeTrivial(S.Context, QTN->getQualifier(), Loc); if (Arg.getKind() == TemplateArgument::Template) @@ -3229,9 +3232,9 @@ static bool AdjustFunctionParmAndArgTypesForDeduction(Sema &S, return false; } -static bool hasDeducibleTemplateParameters(Sema &S, - FunctionTemplateDecl *FunctionTemplate, - QualType T); +static bool +hasDeducibleTemplateParameters(Sema &S, FunctionTemplateDecl *FunctionTemplate, + QualType T); /// \brief Perform template argument deduction by matching a parameter type /// against a single expression, where the expression is an element of @@ -3488,8 +3491,8 @@ Sema::TemplateDeductionResult Sema::DeduceTemplateArguments( } return FinishTemplateArgumentDeduction(FunctionTemplate, Deduced, - NumExplicitlySpecified, - Specialization, Info, &OriginalCallArgs); + NumExplicitlySpecified, Specialization, + Info, &OriginalCallArgs); } QualType Sema::adjustCCAndNoReturn(QualType ArgFunctionType, @@ -3788,7 +3791,7 @@ Sema::DeduceTemplateArguments(FunctionTemplateDecl *ConversionTemplate, // C++0x [temp.deduct.conv]p4: // If A is a cv-qualified type, the top level cv-qualifiers of A's - // type are ignored for type deduction. If A is a reference type, the type + // type are ignored for type deduction. If A is a reference type, the type // referred to by A is used for type deduction. A = A.getUnqualifiedType(); } @@ -3842,8 +3845,8 @@ Sema::DeduceTemplateArguments(FunctionTemplateDecl *ConversionTemplate, Specialization = cast_or_null(ConversionSpecialized); // If the conversion operator is being invoked on a lambda closure to convert - // to a ptr-to-function, use the deduced arguments from the conversion function - // to specialize the corresponding call operator. + // to a ptr-to-function, use the deduced arguments from the conversion + // function to specialize the corresponding call operator. // e.g., int (*fp)(int) = [](auto a) { return a; }; if (Result == TDK_Success && isLambdaConversionOperator(ConversionGeneric)) { @@ -3907,9 +3910,10 @@ namespace { public TreeTransform { QualType Replacement; public: - SubstituteAutoTransform(Sema &SemaRef, QualType Replacement) : - TreeTransform(SemaRef), Replacement(Replacement) { - } + SubstituteAutoTransform(Sema &SemaRef, QualType Replacement) + : TreeTransform(SemaRef), + Replacement(Replacement) {} + QualType TransformAutoType(TypeLocBuilder &TLB, AutoTypeLoc TL) { // If we're building the type pattern to deduce against, don't wrap the // substituted type in an AutoType. Certain template deduction rules @@ -4885,8 +4889,8 @@ MarkUsedTemplateParameters(ASTContext &Ctx, QualType T, Depth, Used); // C++0x [temp.deduct.type]p9: - // If the template argument list of P contains a pack expansion that is not - // the last template argument, the entire template argument list is a + // If the template argument list of P contains a pack expansion that is + // not the last template argument, the entire template argument list is a // non-deduced context. if (OnlyDeduced && hasPackExpansionBeforeEnd(Spec->getArgs(), Spec->getNumArgs())) @@ -5069,10 +5073,9 @@ Sema::MarkUsedTemplateParameters(const TemplateArgumentList &TemplateArgs, /// \brief Marks all of the template parameters that will be deduced by a /// call to the given function template. -void -Sema::MarkDeducedTemplateParameters(ASTContext &Ctx, - const FunctionTemplateDecl *FunctionTemplate, - llvm::SmallBitVector &Deduced) { +void Sema::MarkDeducedTemplateParameters( + ASTContext &Ctx, const FunctionTemplateDecl *FunctionTemplate, + llvm::SmallBitVector &Deduced) { TemplateParameterList *TemplateParams = FunctionTemplate->getTemplateParameters(); Deduced.clear(); diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 14c6405016..f44780407b 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1023,7 +1023,7 @@ TemplateInstantiator::RebuildElaboratedType(SourceLocation KeywordLoc, TemplateName TemplateInstantiator::TransformTemplateName(CXXScopeSpec &SS, TemplateName Name, - SourceLocation NameLoc, + SourceLocation NameLoc, QualType ObjectType, NamedDecl *FirstQualifierInScope) { if (TemplateTemplateParmDecl *TTP @@ -1255,8 +1255,8 @@ TemplateInstantiator::TransformFunctionParmPackRefExpr(DeclRefExpr *E, Decl *TransformedDecl; if (DeclArgumentPack *Pack = Found->dyn_cast()) { - // If this is a reference to a function parameter pack which we can substitute - // but can't yet expand, build a FunctionParmPackExpr for it. + // If this is a reference to a function parameter pack which we can + // substitute but can't yet expand, build a FunctionParmPackExpr for it. if (getSema().ArgumentPackSubstitutionIndex == -1) { QualType T = TransformType(E->getType()); if (T.isNull()) diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 83ec591b85..c1a7a48138 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -560,10 +560,9 @@ public: TemplateName Template, CXXScopeSpec &SS); - QualType - TransformDependentTemplateSpecializationType(TypeLocBuilder &TLB, - DependentTemplateSpecializationTypeLoc TL, - NestedNameSpecifierLoc QualifierLoc); + QualType TransformDependentTemplateSpecializationType( + TypeLocBuilder &TLB, DependentTemplateSpecializationTypeLoc TL, + NestedNameSpecifierLoc QualifierLoc); /// \brief Transforms the parameters of a function type into the /// given vectors. @@ -5145,8 +5144,8 @@ TreeTransform::TransformElaboratedType(TypeLocBuilder &TLB, if (const TemplateSpecializationType *TST = NamedT->getAs()) { TemplateName Template = TST->getTemplateName(); - if (TypeAliasTemplateDecl *TAT = - dyn_cast_or_null(Template.getAsTemplateDecl())) { + if (TypeAliasTemplateDecl *TAT = dyn_cast_or_null( + Template.getAsTemplateDecl())) { SemaRef.Diag(TL.getNamedTypeLoc().getBeginLoc(), diag::err_tag_reference_non_tag) << 4; SemaRef.Diag(TAT->getLocation(), diag::note_declared_at); @@ -7925,15 +7924,11 @@ TreeTransform::TransformCXXNamedCastExpr(CXXNamedCastExpr *E) { Type == E->getTypeInfoAsWritten() && SubExpr.get() == E->getSubExpr()) return E; - return getDerived().RebuildCXXNamedCastExpr(E->getOperatorLoc(), - E->getStmtClass(), - E->getAngleBrackets().getBegin(), - Type, - E->getAngleBrackets().getEnd(), - // FIXME. this should be '(' location - E->getAngleBrackets().getEnd(), - SubExpr.get(), - E->getRParenLoc()); + return getDerived().RebuildCXXNamedCastExpr( + E->getOperatorLoc(), E->getStmtClass(), E->getAngleBrackets().getBegin(), + Type, E->getAngleBrackets().getEnd(), + // FIXME. this should be '(' location + E->getAngleBrackets().getEnd(), SubExpr.get(), E->getRParenLoc()); } template -- 2.40.0