#include <iostream>
using namespace std;

struct Base {
	void foo();
};

struct Derived : Base {};

template<typename T, T thing>
struct bar {};

template<typename T>
void foo() {
	bar<void (T::*)(), &T::foo>{};
}

int main() {
	foo<Base>(); // Works
	foo<Derived>(); // Error
}