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

Daniel Grumberg via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 09:20:21 PDT 2024


================
@@ -54,6 +54,13 @@ RecordContext *APIRecord::castToRecordContext(const APIRecord *Record) {
   }
 }
 
+void RecordContext::stealRecordChain(RecordContext &Other) {
+  First = Other.First;
+  Last = Other.Last;
+  Other.First = nullptr;
+  Other.Last = nullptr;
+}
----------------
daniel-grumberg wrote:

There is no harm in "stealing" an empty record chain, and it's not necessarily even semantically wrong, all it indicates is that the current RecordContext won't have any children during any traversals. Semantic problems would still be caught by having a test.

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


More information about the cfe-commits mailing list