xazax.hun added a comment. In https://reviews.llvm.org/D34275#785294, @wangxindsb wrote:
> > What about: > > > > struct A { > > A() { > > X x; > > x.virtualMethod(); // this virtual call is ok > > foo(); // should warn here > > } > > virtual foo(); > > } > > int main() { > > A a; > > } > > > > > > Does the checker warn on the second call? > > Yes, the checker warn on the second call. Oh, I think I see how it works now. How about: struct A; struct X { void callFooOfA(A*); }; struct A { A() { X x; x.virtualMethod(); // this virtual call is ok x.callFooOfA(this) } virtual foo(); }; void X::callFooOfA(A* a) { a->foo(); // Would be good to warn here. } int main() { A a; } ================ Comment at: lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp:1 -//=======- VirtualCallChecker.cpp --------------------------------*- C++ -*-==// -// ---------------- Please add the license back. https://reviews.llvm.org/D34275 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits