//
// This actually refers very narrowly to the lvalue-to-rvalue conversion, not
// to the array-to-pointer or function-to-pointer conversions.
- if (!TTy->getAs<TagType>())
- TTy = TTy.getUnqualifiedType();
+ TTy = TTy.getNonLValueExprType(Self.Context);
InitializedEntity Entity = InitializedEntity::InitializeTemporary(TTy);
InitializationSequence InitSeq(Self, Entity, Kind, From);
UnwrappedArgs.size() == 1 && UnwrappedArgs[0]->isRValue() &&
S.Context.hasSameUnqualifiedType(UnwrappedArgs[0]->getType(), DestType)) {
// Convert qualifications if necessary.
- QualType InitType = UnwrappedArgs[0]->getType();
- ImplicitConversionSequence ICS;
- ICS.setStandard();
- ICS.Standard.setAsIdentityConversion();
- ICS.Standard.setFromType(InitType);
- ICS.Standard.setAllToTypes(InitType);
- if (!S.Context.hasSameType(InitType, DestType)) {
- ICS.Standard.Third = ICK_Qualification;
- ICS.Standard.setToType(2, DestType);
- }
- Sequence.AddConversionSequenceStep(ICS, DestType);
+ Sequence.AddQualificationConversionStep(DestType, VK_RValue);
if (ILE)
Sequence.RewrapReferenceInitList(DestType, ILE);
return;
// FIXME: Mark this copy as extraneous.
if (!S.getLangOpts().CPlusPlus1z)
Sequence.AddFinalCopy(DestType);
+ else if (DestType.hasQualifiers())
+ Sequence.AddQualificationConversionStep(DestType, VK_RValue);
return;
}
Function->getReturnType()->isReferenceType() ||
!S.Context.hasSameUnqualifiedType(ConvType, DestType))
Sequence.AddFinalCopy(DestType);
+ else if (!S.Context.hasSameType(ConvType, DestType))
+ Sequence.AddQualificationConversionStep(DestType, VK_RValue);
return;
}