Issue #2304395 by jhodgdon: Keep track of references for constants