diff options
-rw-r--r-- | clang/include/clang/AST/DeclCXX.h | 6 | ||||
-rw-r--r-- | clang/include/clang/AST/ExprCXX.h | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h index 7ec391f4640..0b835ecd736 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -2236,7 +2236,7 @@ public: const CXXRecordDecl *Decl); Qualifiers getMethodQualifiers() const { - return getType()->getAs<FunctionProtoType>()->getMethodQuals(); + return getType()->castAs<FunctionProtoType>()->getMethodQuals(); } /// Retrieve the ref-qualifier associated with this method. @@ -2251,7 +2251,7 @@ public: /// }; /// @endcode RefQualifierKind getRefQualifier() const { - return getType()->getAs<FunctionProtoType>()->getRefQualifier(); + return getType()->castAs<FunctionProtoType>()->getRefQualifier(); } bool hasInlineBody() const; @@ -2905,7 +2905,7 @@ public: /// Returns the type that this conversion function is converting to. QualType getConversionType() const { - return getType()->getAs<FunctionType>()->getReturnType(); + return getType()->castAs<FunctionType>()->getReturnType(); } /// Determine whether this conversion function is a conversion from diff --git a/clang/include/clang/AST/ExprCXX.h b/clang/include/clang/AST/ExprCXX.h index e554968caba..bc7d7c0a320 100644 --- a/clang/include/clang/AST/ExprCXX.h +++ b/clang/include/clang/AST/ExprCXX.h @@ -2096,8 +2096,7 @@ public: bool IsParenTypeId); QualType getAllocatedType() const { - assert(getType()->isPointerType()); - return getType()->getAs<PointerType>()->getPointeeType(); + return getType()->castAs<PointerType>()->getPointeeType(); } TypeSourceInfo *getAllocatedTypeSourceInfo() const { |