Target unnecessary templating warning at lines consisting of a single variable

Fixes #6407