[all-commits] [llvm/llvm-project] 47de90: [clang] Fix crash 'Cannot get layout of forward de...

Balázs Kéri via All-commits all-commits at lists.llvm.org
Wed Sep 3 03:18:28 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 47de90e285aeec1acc8595c4b327cd823c069c90
      https://github.com/llvm/llvm-project/commit/47de90e285aeec1acc8595c4b327cd823c069c90
  Author: Balázs Kéri <balazs.keri at ericsson.com>
  Date:   2025-09-03 (Wed, 03 Sep 2025)

  Changed paths:
    M clang/lib/AST/ASTImporter.cpp
    A clang/test/Analysis/ctu-import-type-decl-definition.c

  Log Message:
  -----------
  [clang] Fix crash 'Cannot get layout of forward declarations' during CTU static analysis (#156056)

When a type is imported with `ASTImporter`, the "original declaration"
of the type is imported. In some cases this is not the definition
(of the class). Before the fix the definition was only imported if
there was an other reference to it in the AST to import. This is not
always the case (like in the added test case), if not the definition
was missing in the "To" AST which can cause the assertion later.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list