While answering a different question, I could not find a reason for why the following code would be disallowed.
template <typename F> void bar (F *f) { f->a = 0; }
int main () {
struct Foo { int a; } f = { 3 };
bar(&f); // fail
}
The explanation I provided was that the compiler would have no way to legally express the template expansion, but that is more my intuition than a reason. Is there a definitive explanation as to why the code should not compile?