aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-29 21:53:49 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-29 21:53:49 +0000
commit6217b80b7a1379b74cced1c076338262c3c980b3 (patch)
tree771e3d3432ec70a00de34956f44a930a3012bc72 /lib/Sema/SemaTemplate.cpp
parentf7a0cf426eddae76e1a71dd2295631a2cf0560af (diff)
Change uses of:
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp18
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