CXXRecordDecl::viewInheritance crashes


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()) {



   return true;


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


Côme David

Thanks for reporting the issue!

I reproduced the issue and filed a bug report at with the relevant portion of the backtrace attached.