Your code invokes undefined behaviour. ten+8
creates a temporary, whose lifetime ends at the end of the full-expression in which it appears (in your case, the semicolon). getLvalueRef
then returns a reference to this temporary.
Any usage of this reference past the full-expression in which ten+8
was created is not allowed.