1279 llvm 14 (#1282)

* traverse enum type on llvm 14 #1279
This commit is contained in:
Scott Fennell
2022-06-09 09:42:06 -05:00
committed by GitHub
parent ae55e7f5ab
commit 33d2a53e12
3 changed files with 14 additions and 13 deletions

View File

@ -79,7 +79,13 @@ bool CXXRecordVisitor::TraverseDecl(clang::Decl *d) {
/* This is an embedded enumeration within a class. Only process it if is public */
if ( ed->getAccess() == clang::AS_public ) {
EnumVisitor evis(ci, hsd) ;
// Before llvm 14, TraverseDecl also traversed the type.
// llvm believed this to be a bug, so now we call TraverseType
// in addition to TraverseDecl.
evis.TraverseDecl(ed) ;
#if (LIBCLANG_MAJOR >= 14)
evis.TraverseType(clang::QualType(ed->getTypeForDecl(), 0));
#endif
pa.printEnum(evis.get_enum_data()) ;
} else {
// protected and private embedded classes cannot be used outside of their class