struct foo {
virtual int bleh() {
return 42;
}
};
template<typename T>
struct bar : public foo {
};
template<>
int bar<char>::bleh() {
return 12;
}
int main() {
bar<char> x;
return x.bleh();
}
c3RydWN0IGZvbyB7CiAgICB2aXJ0dWFsIGludCBibGVoKCkgewogICAgICAgIHJldHVybiA0MjsKICAgIH0KfTsKCgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPgpzdHJ1Y3QgYmFyIDogcHVibGljIGZvbyB7Cgp9OwoKdGVtcGxhdGU8PgppbnQgYmFyPGNoYXI+OjpibGVoKCkgewogICAgcmV0dXJuIDEyOwp9CgppbnQgbWFpbigpIHsKICAgIGJhcjxjaGFyPiB4OwogICAgcmV0dXJuIHguYmxlaCgpOwp9Cg==