<div dir="ltr"><div>Hi All,<br><br></div><div>I am facing a build issue while compiling llvm,clang on xlc 12.1 on AIX 7. <br>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.<br></div><div><br><span style="font-family:courier new,monospace"> 492 /// Declaration of a redeclarable template.</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 493 class RedeclarableTemplateDecl : public TemplateDecl,</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 494                                  public Redeclarable<RedeclarableTemplateDecl></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 495 {</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 496   typedef Redeclarable<RedeclarableTemplateDecl> redeclarable_base;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 497   virtual RedeclarableTemplateDecl *getNextRedeclaration() {</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 498     return RedeclLink.getNext();</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 499   }</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 500   virtual RedeclarableTemplateDecl *getPreviousDeclImpl() {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 501     return getPreviousDecl();</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 502   }</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 503   virtual RedeclarableTemplateDecl *getMostRecentDeclImpl() {</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 504     return getMostRecentDecl();</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 505   }</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 506</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 507 protected:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 508   template <typename EntryType> struct SpecEntryTraits {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 509     typedef EntryType DeclType;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 510</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 511     static DeclType *getMostRecentDecl(EntryType *D) {</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 512       return D->getMostRecentDecl();</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 513     }</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 514   };</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 515</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 516   template <typename EntryType,</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 517             typename _SETraits = SpecEntryTraits<EntryType>,</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 518             typename _DeclType = typename _SETraits::DeclType></span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 519   class SpecIterator : public std::iterator<std::forward_iterator_tag,</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 520                                             _DeclType*, ptrdiff_t,</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 521                                             _DeclType*, _DeclType*> {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 522     typedef _SETraits SETraits;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 523     typedef _DeclType DeclType;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 524</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 525     typedef typename llvm::FoldingSetVector<EntryType>::iterator</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"></div><div><b><u>Specialization code:</u></b><br style="font-family:courier new,monospace"></div><div><span style="font-family:courier new,monospace"> 693</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 694 template <> struct RedeclarableTemplateDecl::</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 695 SpecEntryTraits<FunctionTemplateSpecializationInfo> {</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 696   typedef FunctionDecl DeclType;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 697</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 698   static DeclType *</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 699   getMostRecentDecl(FunctionTemplateSpecializationInfo *I) {</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 700     return I->Function->getMostRecentDecl();</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 701   }</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 702 };</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"></div><div><u><b>Code fails here</b></u><br style="font-family:courier new,monospace">
</div><div><span style="font-family:courier new,monospace"> 798</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> 799   typedef SpecIterator<FunctionTemplateSpecializationInfo> spec_iterator;</span>  ==> code fails here <br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 800</span><br style="font-family:courier new,monospace"><br><br>Error:<br>"/llvm/version2/llvm/tools/clang/include/clang/AST/DeclTemplate.h", line 799.16: 1540-1109 (S) The use of undefined class "clang::RedeclarableTemplateDecl::SpecEntryTraits<clang::FunctionTemplateSpecializationInfo>" is not valid.<br>
<br></div><div><br>-------------------<div>Thanks<br>Sunil<br></div>
</div></div>