prog.cpp: In instantiation of ‘struct Dvf<NV>’:
prog.cpp:14:44: required by substitution of ‘template<class T> static uint8_t has_virtual_f<U>::check(has_virtual_f<U>::helper<sizeof (Dvf<T>)>*) [with T = T; U = NV] [with T = NV]’
prog.cpp:18:40: required from ‘constexpr const bool has_virtual_f<NV>::value’
prog.cpp:28:35: required from here
prog.cpp:4:45: error: ‘void Dvf<T>::f() [with T = NV]’ marked final, but is not virtual
template <typename T> struct Dvf : T { void f() final; };
^
prog.cpp:28:1: error: static assertion failed:
static_assert(!has_virtual_f<NV>::value, "");
^
prog.cpp: In instantiation of ‘struct Dvf<E>’:
prog.cpp:14:44: required by substitution of ‘template<class T> static uint8_t has_virtual_f<U>::check(has_virtual_f<U>::helper<sizeof (Dvf<T>)>*) [with T = T; U = E] [with T = E]’
prog.cpp:18:40: required from ‘constexpr const bool has_virtual_f<E>::value’
prog.cpp:29:35: required from here
prog.cpp:4:45: error: ‘void Dvf<T>::f() [with T = E]’ marked final, but is not virtual
template <typename T> struct Dvf : T { void f() final; };
^
prog.cpp:29:1: error: static assertion failed:
static_assert(!has_virtual_f< E>::value, "");
^