Skip to content

Clang crash with -Wunsafe-buffer-usage on assertion failure: const ASTRecordLayout &clang::ASTContext::getASTRecordLayout(const RecordDecl *) const: Assertion `D && "Cannot get layout of forward declarations!"' failed. #116286

@ZequanWu

Description

@ZequanWu

Trunk clang crashes with -Wunsafe-buffer-usage: https://godbolt.org/z/Pjj413W68 and https://godbolt.org/z/j4hnY3eEz.

#91991 (reverted) introduced the same crash with -Wunsafe-buffer-usage: https://godbolt.org/z/vcv8d6sYr, which is likely due to the same underlying issue.

Metadata

Metadata

Assignees

Labels

clang:analysiscrashPrefer [crash-on-valid] or [crash-on-invalid]

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions