diff options
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 245ba3f8f2..425b50263f 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -254,8 +254,8 @@ Sema::CheckNonTypeTemplateParameterType(QualType T, SourceLocation Loc) { if (T->isIntegralType() || T->isEnumeralType() || // -- pointer to object or pointer to function, (T->isPointerType() && - (T->getAsPointerType()->getPointeeType()->isObjectType() || - T->getAsPointerType()->getPointeeType()->isFunctionType())) || + (T->getAs<PointerType>()->getPointeeType()->isObjectType() || + T->getAs<PointerType>()->getPointeeType()->isFunctionType())) || // -- reference to object or reference to function, T->isReferenceType() || // -- pointer to member. @@ -810,7 +810,7 @@ Sema::MatchTemplateParametersToScopeSpecifier(SourceLocation DeclStartLoc, if (!Template) continue; // FIXME: should this be an error? probably... - if (const RecordType *Record = SpecType->getAsRecordType()) { + if (const RecordType *Record = SpecType->getAs<RecordType>()) { ClassTemplateSpecializationDecl *SpecDecl = cast<ClassTemplateSpecializationDecl>(Record->getDecl()); // If the nested name specifier refers to an explicit specialization, @@ -1408,7 +1408,7 @@ bool Sema::CheckTemplateArgument(TemplateTypeParmDecl *Param, const TagType *Tag = 0; if (const EnumType *EnumT = Arg->getAsEnumType()) Tag = EnumT; - else if (const RecordType *RecordT = Arg->getAsRecordType()) + else if (const RecordType *RecordT = Arg->getAs<RecordType>()) Tag = RecordT; if (Tag && Tag->getDecl()->getDeclContext()->isFunctionOrMethod()) return Diag(ArgLoc, diag::err_template_arg_local_type) @@ -1727,13 +1727,13 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // function is selected from the set (13.4). // In C++0x, any std::nullptr_t value can be converted. (ParamType->isPointerType() && - ParamType->getAsPointerType()->getPointeeType()->isFunctionType()) || + ParamType->getAs<PointerType>()->getPointeeType()->isFunctionType()) || // -- For a non-type template-parameter of type reference to // function, no conversions apply. If the template-argument // represents a set of overloaded functions, the matching // function is selected from the set (13.4). (ParamType->isReferenceType() && - ParamType->getAsReferenceType()->getPointeeType()->isFunctionType()) || + ParamType->getAs<ReferenceType>()->getPointeeType()->isFunctionType()) || // -- For a non-type template-parameter of type pointer to // member function, no conversions apply. If the // template-argument represents a set of overloaded member @@ -1741,7 +1741,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // the set (13.4). // Again, C++0x allows a std::nullptr_t value. (ParamType->isMemberPointerType() && - ParamType->getAsMemberPointerType()->getPointeeType() + ParamType->getAs<MemberPointerType>()->getPointeeType() ->isFunctionType())) { if (Context.hasSameUnqualifiedType(ArgType, ParamType.getNonReferenceType())) { @@ -1802,7 +1802,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, // object, qualification conversions (4.4) and the // array-to-pointer conversion (4.2) are applied. // C++0x also allows a value of std::nullptr_t. - assert(ParamType->getAsPointerType()->getPointeeType()->isObjectType() && + assert(ParamType->getAs<PointerType>()->getPointeeType()->isObjectType() && "Only object pointers allowed here"); if (ArgType->isNullPtrType()) { @@ -1837,7 +1837,7 @@ bool Sema::CheckTemplateArgument(NonTypeTemplateParmDecl *Param, return false; } - if (const ReferenceType *ParamRefType = ParamType->getAsReferenceType()) { + if (const ReferenceType *ParamRefType = ParamType->getAs<ReferenceType>()) { // -- For a non-type template-parameter of type reference to // object, no conversions apply. The type referred to by the // reference may be more cv-qualified than the (otherwise |