[clang] [clang][ExtractAPI] Fix handling of anonymous TagDecls (PR #87772)

via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 07:21:06 PDT 2024


================
@@ -54,6 +54,20 @@ RecordContext *APIRecord::castToRecordContext(const APIRecord *Record) {
   }
 }
 
+void RecordContext::stealRecordChain(RecordContext &Other) {
+  // If we don't have an empty chain append Other's chain into ours.
+  if (First)
+    Last->NextInContext = Other.First;
----------------
QuietMisdreavus wrote:

This is the tiniest of nitpicks, but the fact that this only checks `First` but then accesses `Last` (which semantically makes sense but is semantically suspect) feels wrong to me. 😅  

https://github.com/llvm/llvm-project/pull/87772


More information about the cfe-commits mailing list