================
@@ -6714,7 +6714,8 @@ void InitializationSequence::InitializeFrom(Sema &S,
OverloadCandidateSet::iterator Best;
OverloadingResult OR = getFailedCandidateSet().BestViableFunction(
S, Kind.getLocation(), Best);
- if (OR != OverloadingResult::OR_Deleted) {
+ if (OR != OverloadingResult::OR_Deleted &&
+ Kind.getKind() == InitializationKind::IK_Direct) {
----------------
offsetof wrote:
This is https://eel.is/c++draft/dcl.init.general#16.6.2.2.sentence-1,
specifically "and the initializer is a parenthesized *expression-list*". The
bug is that `X x = y;` is treated as `X x(y);` when `y` has type <code>*cv*
X</code> and `X` has no viable constructor for the initialization.
The linked core issue is indeed related to arrays (handled by a different
bullet) and is not relevant here.
https://github.com/llvm/llvm-project/pull/131320
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits