CodeGen: Reference temporaries inherit visibility

Reference temporaries inherited many properties from the variable that
they correspond to but visibility wasn't one of them.