[LLVMdev] Build Error while building AST lib. (DeclTemplate.h)

Sunil Saggar sunil.saggar at gmail.com
Wed Jan 23 01:21:14 PST 2013


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<RedeclarableTemplateDecl>
 495 {
 496   typedef Redeclarable<RedeclarableTemplateDecl> 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 <typename EntryType> 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<EntryType>,
 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<EntryType>::iterator


*Specialization code:*
 693
 694 template <> struct RedeclarableTemplateDecl::
 695 SpecEntryTraits<FunctionTemplateSpecializationInfo> {
 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<FunctionTemplateSpecializationInfo>
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::SpecEntryTraits<clang::FunctionTemplateSpecializationInfo>"
is not valid.


-------------------
Thanks
Sunil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130123/3ef6bc17/attachment.html>


More information about the llvm-dev mailing list