This is an archive of the discontinued LLVM Phabricator instance.

Fix unexpected nullptr in ConceptSpecializationExpr's ArgsAsWritten field
AcceptedPublic

Authored by yeswalrus on Mar 22 2023, 5:58 PM.

Details

Reviewers
erichkeane
Summary

Fix ArgsAsWritten being null for ConceptSpecializationExpr in certain circumstances when parsing ASTs

ASTStmtWriter::VisitConceptSpecializationExpr expects getTemplateArgsAsWritten() to return a real value, which it wasn't when parsed by ASTContext.cpp in certain edge cases.

Resubmitting https://reviews.llvm.org/differential/revision/edit/146678/ rebased on the llvm-16.0.0 branch.

Diff Detail

Event Timeline

yeswalrus created this revision.Mar 22 2023, 5:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 5:58 PM
yeswalrus requested review of this revision.Mar 22 2023, 5:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2023, 5:58 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
yeswalrus retitled this revision from Add test for AST Writer crash to Fix unexpected nullptr in ConceptSpecializationExpr's ArgsAsWritten field.Mar 22 2023, 6:03 PM
yeswalrus edited the summary of this revision. (Show Details)
yeswalrus added a reviewer: erichkeane.

Resolves https://github.com/llvm/llvm-project/issues/61486, Similar to https://reviews.llvm.org/D146678 but targeting the llvm-16 series.

yeswalrus edited the summary of this revision. (Show Details)Mar 22 2023, 6:04 PM

Hoping this can make it into clang-16.0.1, since the crash this causes makes clangd unusable in codebases using concepts in template arguments in this manner.

yeswalrus edited the summary of this revision. (Show Details)Mar 22 2023, 6:07 PM
erichkeane accepted this revision.Mar 23 2023, 6:00 AM
This revision is now accepted and ready to land.Mar 23 2023, 6:00 AM