CXXRecordDecl::viewInheritance crashes

Hello,

I found that CXXRecordDecl::viewInheritance crashes on the following code when printing C inheritance

template <class T> struct A {};
template <class U> class C: A<U>{};

My visitor for XXXRecordDecl is the following :

bool Visitor::VisitCXXRecordDecl(clang::CXXRecordDecl *c) {

   if (c->getNumBases() || c->getNumVBases()) {

      c->viewInheritance(astContext);

   }

   return true;

}

I wanted to open a bug report but I don't have an account.

Regards,

Côme David

Thanks for reporting the issue!

I reproduced the issue and filed a bug report at http://bugs.llvm.org/show_bug.cgi?id=32095 with the relevant portion of the backtrace attached.

Alex