[clang] [modules] Handle friend function that was a definition but became only a declaration during AST deserialization (PR #132214)

Dmitry Polukhin via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 2 02:41:11 PDT 2025


================
@@ -1392,6 +1392,20 @@ class ASTReader
 
   llvm::DenseMap<const Decl *, bool> DefinitionSource;
 
+  /// The set of extra flags about declarations that we have read from
+  /// the module file.
+  struct ExternalDeclarationBits {
+    /// Indicates if given function declaration was a definition but its body
+    /// was removed due to declaration merging.
+    bool ThisDeclarationWasADefinition : 1;
+
+    ExternalDeclarationBits() : ThisDeclarationWasADefinition(false) {}
+  };
+
+  /// A mapping from declarations to extra bits of information about this decl.
+  llvm::DenseMap<const Decl *, ExternalDeclarationBits>
----------------
dmpolukhin wrote:

In this case we don't even need map, I replaced with with a set.

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


More information about the cfe-commits mailing list