Unsure if
auto
is supposed to work or not, but the fact that it starts working when you change fun()
to the second snippet is definitely a bug.