Revert "Revert "[index] Handle properly C++14's template variables.""

This reverts commit 3cd084159645e4ef5560c3db16be697ef6718e3d.
The API has been cherry-picked.
4 files changed