juliehockett created this revision.
juliehockett added reviewers: jakehehrlich, leonardchan, lebedev.ri.
juliehockett added a project: clang-tools-extra.

Don't try to parse base classes for declarations that are not definitions 
(segfaults, as there is no DefinitionData to access).


https://reviews.llvm.org/D52313

Files:
  clang-tools-extra/clang-doc/Serialize.cpp


Index: clang-tools-extra/clang-doc/Serialize.cpp
===================================================================
--- clang-tools-extra/clang-doc/Serialize.cpp
+++ clang-tools-extra/clang-doc/Serialize.cpp
@@ -244,6 +244,9 @@
 }
 
 static void parseBases(RecordInfo &I, const CXXRecordDecl *D) {
+  // Don't parse bases if this isn't a definition.
+  if (!D->isThisDeclarationADefinition())
+    return;
   for (const CXXBaseSpecifier &B : D->bases()) {
     if (B.isVirtual())
       continue;


Index: clang-tools-extra/clang-doc/Serialize.cpp
===================================================================
--- clang-tools-extra/clang-doc/Serialize.cpp
+++ clang-tools-extra/clang-doc/Serialize.cpp
@@ -244,6 +244,9 @@
 }
 
 static void parseBases(RecordInfo &I, const CXXRecordDecl *D) {
+  // Don't parse bases if this isn't a definition.
+  if (!D->isThisDeclarationADefinition())
+    return;
   for (const CXXBaseSpecifier &B : D->bases()) {
     if (B.isVirtual())
       continue;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to