The purpose of this addition is to be able to write AST matchers that match class template member functions by fully qualified name, without the need to explicitly specify the template arguments in the name.
For example, to match the call to S::f here
template <typename T> struct S { void f(); }; void foo() { S<int> s; s.f(); }
the matcher currently needs to specify the template arguments:
callExpr(callee(functionDecl(hasName("::S<int>::f"))))
With the help of this change, it's possible to create a version of hasName that ignores the template arguments. The matcher could then be written as
callExpr(callee(functionDecl(hasNameIgnoringTemplateArgs("::S::f"))))
The motivation for this change is to be able to add checking of class template member functions to clang-tidy checker bugprone-unused-return-value: http://clang.llvm.org/extra/clang-tidy/checks/bugprone-unused-return-value.html
The discussion about this can be found in the code review for the checker: https://reviews.llvm.org/D41655?id=130461#inline-374438