Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class NoUncountedMemberChecker final : public RawPtrRefMemberChecker {
std::optional<bool>
isPtrCompatible(const clang::QualType,
const clang::CXXRecordDecl *R) const final {
return R && isRefCountable(R);
return R ? isRefCountable(R) : std::nullopt;
}

bool isPtrCls(const clang::CXXRecordDecl *R) const final {
Expand All @@ -246,7 +246,7 @@ class NoUncheckedPtrMemberChecker final : public RawPtrRefMemberChecker {
std::optional<bool>
isPtrCompatible(const clang::QualType,
const clang::CXXRecordDecl *R) const final {
return R && isCheckedPtrCapable(R);
return R ? isCheckedPtrCapable(R) : std::nullopt;
}

bool isPtrCls(const clang::CXXRecordDecl *R) const final {
Expand Down
10 changes: 9 additions & 1 deletion clang/test/Analysis/Checkers/WebKit/uncounted-members.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace members {
};
}


namespace ignore_unions {
union Foo {
RefCountable* a;
Expand All @@ -60,3 +59,12 @@ void foo(RefCountable* t) {
}

} // ignore_system_header

namespace ignore_non_ref_countable {
struct Foo {
};

struct Bar {
Foo* foo;
};
}