Fixed #23114 -- Clarified documentation of template lookups.

Thanks to gmunumel and Tom Dalton for their help on the patch.