This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Fix a crash when trying to initialize an invalid aggregate.
ClosedPublic

Authored by cor3ntin on Jul 5 2023, 2:34 AM.

Details

Summary

We did not return an error when failing to producing
a valid expression when performing the initialization of
an aggregate initialized with a parenthesized list of expressions.

This is a regression introduced in Clang 17.

Fixes #63278

Diff Detail

Event Timeline

cor3ntin created this revision.Jul 5 2023, 2:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2023, 2:34 AM
cor3ntin requested review of this revision.Jul 5 2023, 2:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2023, 2:34 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cor3ntin added reviewers: aaron.ballman, Restricted Project.Jul 5 2023, 2:35 AM

Precommit CI found issues with the newly added test that should be addressed.

clang/docs/ReleaseNotes.rst
633–634

This is a new regression introduced in Clang 17, so I don't think we need a release note, right?

clang/lib/Sema/SemaInit.cpp
9390

Please spell out the type (and make it a const pointer if possible).

clang/test/SemaCXX/paren-list-agg-init.cpp
281

Probably worth it to add a static auto y = 1; case as well?

cor3ntin updated this revision to Diff 537319.Jul 5 2023, 5:41 AM

Address Aaron's Feedback

This revision is now accepted and ready to land.Jul 5 2023, 6:34 AM
This revision was landed with ongoing or failed builds.Jul 5 2023, 6:45 AM
This revision was automatically updated to reflect the committed changes.