-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang] Fix a crash when casting to an array type
In C++20, if Clang fails to perform constructor overload on a RecordType, then Clang will try to perform parentesized aggregate initialization. If that fails and the initialization was attempted as part of a cast, then we should get the diagnostics from the failed constructor overload attempt. However, we don't attempt constructor overloading for arrays, so previously, if we try to diagnose an overloaded cast for a parenthesized aggregate initialization of an array, we crash. To fix this, we now exit tryDiagnoseOverloadedCast(...) for failed parentesized list initialization if the destination type is an array. Fixes #63758 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D155523
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters