24 lines · cpp
1// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.NoUncountedMemberChecker -verify %s2 3#include "mock-types.h"4 5class RefCountedBase {6public:7 void ref() const { }8};9 10template<typename T> class RefCounted : public RefCountedBase {11public:12 virtual ~RefCounted() { }13 void deref() const { }14};15 16class TreeNode : public RefCounted<TreeNode> {17public:18 void setParent(TreeNode& parent) { m_parent = &parent; }19 20private:21 TreeNode* m_parent;22// expected-warning@-1{{Member variable 'm_parent' in 'TreeNode' is a raw pointer to ref-countable type 'TreeNode'}}23};24