// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.NoUncountedMemberChecker -verify %s #include "mock-types.h" namespace members { struct Foo { private: RefCountable* a = nullptr; // expected-warning@-1{{Member variable 'a' in 'members::Foo' is a raw pointer to ref-countable type 'RefCountable'}} protected: RefPtr b; public: RefCountable silenceWarningAboutInit; RefCountable& c = silenceWarningAboutInit; // expected-warning@-1{{Member variable 'c' in 'members::Foo' is a reference to ref-countable type 'RefCountable'}} Ref d; }; template struct FooTmpl { T* a; // expected-warning@-1{{Member variable 'a' in 'members::FooTmpl' is a raw pointer to ref-countable type 'RefCountable'}} }; void forceTmplToInstantiate(FooTmpl) {} } namespace ignore_unions { union Foo { RefCountable* a; RefPtr b; Ref c; }; template union RefPtr { T* a; }; void forceTmplToInstantiate(RefPtr) {} }