// PR sanitizer/64984 // { dg-do compile } // { dg-options "-fsanitize=vptr -std=gnu++11" } template struct K { static constexpr X v = 0; typedef K t; }; template struct A; template struct A : Y { }; template X M (); template struct B; template struct B : K(M()))> { }; template struct G : A>::t { }; template struct J : G { }; template X&& foo (X&); template X&& bar (X&&); template struct P { P (X& x) : q (x) {} X q; }; template struct Q; template struct Q : P { typedef P r; X& s (Q&); Q (X& x) : r (x) {} Q (Q&& x) noexcept (J::v) : r (foo(s (x))) { } }; template struct I : Q { I (); I (X&... x) : Q(x...) { } }; template I baz (X&&... x) { return I (foo(x)...); } template struct F { int p; void operator[] (X&& x) { baz (bar (x)); } }; struct U { virtual ~U (); }; int main () { F m; m[U ()]; }