This is a well known bug... I doubt it will be fixed real soon. We're trying to engineer out all (most) the advantage of named return values, so that people can get away from needing to use this feature. Doing this is probably more important than fixing NRVs in templates.