[clang] [clang] Do not serialize function definitions without a body (PR #121550)

Alejandro Álvarez Ayllón via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 6 01:00:32 PST 2025


================
@@ -7230,6 +7230,9 @@ void ASTWriter::CompletedImplicitDefinition(const FunctionDecl *D) {
   if (!D->isFromASTFile())
     return; // Declaration not imported from PCH.
 
+  if (!D->doesThisDeclarationHaveABody())
+    return; // The function definition may not have a body due to parsing errors.
----------------
alejandro-alvarez-sonarsource wrote:

Moved

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


More information about the cfe-commits mailing list