[PATCH] Source location of "template" keyword in TemplateSpecializationTypeLoc.

Please find attached for review a patch that adds the source location of the optional "template" keyword to TemplateSpecializationTypeLoc, thereby allowing for a more faithful AST representation of constructs such as the following:

namespace N {
template <typename T>
struct S;

template <typename T>
void foo() {
   N::S<T> s; // TSTLoc without template keyword
   N::template S<T> s; // TSTLoc with template keyword

NOTE: we can not exploit the pretty printer to provide a testcase for the patch, because (as far as we can tell) the pretty printer is visiting the Type hierarchy (i.e., it disregards the TypeLoc hierarchy).

While at it, also renamed a few members in class
so as to have a more consistent and clearer naming scheme:
   getKeywordLoc --> getElaboratedKeywordLoc
   getNameLoc --> getTemplateNameLoc

The patch is adding 3 new FIXME's in TreeTransform.h: these will be addressed in a forthcoming patch adding the template keyword location to DependentTemplateSpecializationTypeLoc.


TSTLoc-TemplateKW.patch (26.9 KB)


TSTLoc-TemplateKW.patch (26.9 KB)