On 09/11/2012 09:29 PM, Namespace wrote:
On Tuesday, 11 September 2012 at 19:27:40 UTC, Timon Gehr wrote:
On 09/11/2012 08:57 PM, Maxim Fomin wrote:
I think it is UB rather than a bug.
No, this is a bug.
The spec says that return types must match exactly.
Exactly. If it was UB, the spec would say the behaviour is undefined
if they don't match exactly.
AFAIK auto is a feature to infer return type, not to
magically adjust to multiple incompatible types.
So what? Should my code work or not?
According to the spec it should fail compilation.