Build Error while building AST lib. (DeclTemplate.h)

Hi All,

I am facing a build issue while compiling llvm,clang on xlc 12.1 on AIX 7.
In this case, template specialization code is not getting called. The code compiles fine if i remove the template specialization code [ 694-702 ] but fails later on. Please advise.

492 /// Declaration of a redeclarable template.
493 class RedeclarableTemplateDecl : public TemplateDecl,
494 public Redeclarable
495 {
496 typedef Redeclarable redeclarable_base;
497 virtual RedeclarableTemplateDecl *getNextRedeclaration() {
498 return RedeclLink.getNext();
499 }
500 virtual RedeclarableTemplateDecl *getPreviousDeclImpl() {
501 return getPreviousDecl();
502 }
503 virtual RedeclarableTemplateDecl getMostRecentDeclImpl() {
504 return getMostRecentDecl();
505 }
506
507 protected:
508 template struct SpecEntryTraits {
509 typedef EntryType DeclType;
510
511 static DeclType getMostRecentDecl(EntryType D) {
512 return D->getMostRecentDecl();
513 }
514 };
515
516 template <typename EntryType,
517 typename _SETraits = SpecEntryTraits,
518 typename _DeclType = typename _SETraits::DeclType>
519 class SpecIterator : public std::iterator<std::forward_iterator_tag,
520 _DeclType
, ptrdiff_t,
521 _DeclType
, _DeclType
> {
522 typedef _SETraits SETraits;
523 typedef _DeclType DeclType;
524
525 typedef typename llvm::FoldingSetVector::iterator

Specialization code:

693
694 template <> struct RedeclarableTemplateDecl::
695 SpecEntryTraits {
696 typedef FunctionDecl DeclType;
697
698 static DeclType *
699 getMostRecentDecl(FunctionTemplateSpecializationInfo *I) {
700 return I->Function->getMostRecentDecl();
701 }
702 };

Code fails here

798
799 typedef SpecIterator spec_iterator; ==> code fails here
800

Error:
“/llvm/version2/llvm/tools/clang/include/clang/AST/DeclTemplate.h”, line 799.16: 1540-1109 (S) The use of undefined class “clang::RedeclarableTemplateDecl::SpecEntryTraitsclang::FunctionTemplateSpecializationInfo” is not valid.