// PR c++/80916 // { dg-options "-Os -Wunused" } struct j { virtual void dispatch(void *) {} }; template struct i : j { void dispatch(void *) {} // warning: 'void i< >::dispatch(void*) [with = {anonymous}::l]' declared 'static' but never defined [-Wunused-function] }; namespace { struct l : i {}; } void f(j *k) { k->dispatch(0); }