[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
Please sign in to comment