1 // RUN: %clang_analyze_cc1 -analyzer-checker=webkit.NoUncountedMemberChecker -verify %s 2 3 #include "mock-types.h" 4 5 class RefCountedBase { 6 public: ref() const7 void ref() const { } 8 }; 9 10 template<typename T> class RefCounted : public RefCountedBase { 11 public: ~RefCounted()12 virtual ~RefCounted() { } deref() const13 void deref() const { } 14 }; 15 16 class TreeNode : public RefCounted<TreeNode> { 17 public: setParent(TreeNode & parent)18 void setParent(TreeNode& parent) { m_parent = &parent; } 19 20 private: 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