diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp | 22 | 
1 files changed, 10 insertions, 12 deletions
diff --git a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp index fd4320e..706dd67 100644 --- a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp +++ b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp @@ -44,10 +44,9 @@ ExceptionAnalyzer::ExceptionInfo &ExceptionAnalyzer::ExceptionInfo::merge(  }  // FIXME: This could be ported to clang later. -namespace { -bool isUnambiguousPublicBaseClass(const Type *DerivedType, -                                  const Type *BaseType) { +static bool isUnambiguousPublicBaseClass(const Type *DerivedType, +                                         const Type *BaseType) {    const auto *DerivedClass =        DerivedType->getCanonicalTypeUnqualified()->getAsCXXRecordDecl();    const auto *BaseClass = @@ -78,11 +77,11 @@ bool isUnambiguousPublicBaseClass(const Type *DerivedType,           IsPublicBaseClass;  } -inline bool isPointerOrPointerToMember(const Type *T) { +static bool isPointerOrPointerToMember(const Type *T) {    return T->isPointerType() || T->isMemberPointerType();  } -std::optional<QualType> getPointeeOrArrayElementQualType(QualType T) { +static std::optional<QualType> getPointeeOrArrayElementQualType(QualType T) {    if (T->isAnyPointerType() || T->isMemberPointerType())      return T->getPointeeType(); @@ -92,7 +91,7 @@ std::optional<QualType> getPointeeOrArrayElementQualType(QualType T) {    return std::nullopt;  } -bool isBaseOf(const Type *DerivedType, const Type *BaseType) { +static bool isBaseOf(const Type *DerivedType, const Type *BaseType) {    const auto *DerivedClass = DerivedType->getAsCXXRecordDecl();    const auto *BaseClass = BaseType->getAsCXXRecordDecl();    if (!DerivedClass || !BaseClass) @@ -103,12 +102,12 @@ bool isBaseOf(const Type *DerivedType, const Type *BaseType) {  }  // Check if T1 is more or Equally qualified than T2. -bool moreOrEquallyQualified(QualType T1, QualType T2) { +static bool moreOrEquallyQualified(QualType T1, QualType T2) {    return T1.getQualifiers().isStrictSupersetOf(T2.getQualifiers()) ||           T1.getQualifiers() == T2.getQualifiers();  } -bool isStandardPointerConvertible(QualType From, QualType To) { +static bool isStandardPointerConvertible(QualType From, QualType To) {    assert((From->isPointerType() || From->isMemberPointerType()) &&           (To->isPointerType() || To->isMemberPointerType()) &&           "Pointer conversion should be performed on pointer types only."); @@ -150,7 +149,7 @@ bool isStandardPointerConvertible(QualType From, QualType To) {    return false;  } -bool isFunctionPointerConvertible(QualType From, QualType To) { +static bool isFunctionPointerConvertible(QualType From, QualType To) {    if (!From->isFunctionPointerType() && !From->isFunctionType() &&        !From->isMemberFunctionPointerType())      return false; @@ -192,8 +191,8 @@ bool isFunctionPointerConvertible(QualType From, QualType To) {  // from the C rules.  //  // The function should only be called in C++ mode. -bool isQualificationConvertiblePointer(QualType From, QualType To, -                                       LangOptions LangOpts) { +static bool isQualificationConvertiblePointer(QualType From, QualType To, +                                              LangOptions LangOpts) {    // [N4659 7.5 (1)]    // A cv-decomposition of a type T is a sequence of cv_i and P_i such that T is @@ -320,7 +319,6 @@ bool isQualificationConvertiblePointer(QualType From, QualType To,    return From.getTypePtr() == To.getTypePtr();  } -} // namespace  static bool canThrow(const FunctionDecl *Func) {    // consteval specifies that every call to the function must produce a  | 
