// RUN: %clang_analyze_cc1 -analyzer-checker=webkit.RefCntblBaseVirtualDtor -verify %s struct RefCntblBase { void ref() {} void deref() {} }; template struct DerivedClassTmpl1 : T { }; // expected-warning@-1{{Struct 'RefCntblBase' is used as a base of struct 'DerivedClassTmpl1' but doesn't have virtual destructor}} DerivedClassTmpl1 a; template struct DerivedClassTmpl2 : T { }; // expected-warning@-1{{Struct 'RefCntblBase' is used as a base of struct 'DerivedClassTmpl2' but doesn't have virtual destructor}} template int foo(T) { DerivedClassTmpl2 f; return 42; } int b = foo(RefCntblBase{}); template struct DerivedClassTmpl3 : T { }; // expected-warning@-1{{Struct 'RefCntblBase' is used as a base of struct 'DerivedClassTmpl3' but doesn't have virtual destructor}} typedef DerivedClassTmpl3 Foo; Foo c;