// functions.
CXXRecordDecl *T2RecordDecl = cast<CXXRecordDecl>(T2RecordType->getDecl());
- // Determine the type we are converting to. If we are allowed to
- // convert to an rvalue, take the type that the destination type
- // refers to.
- QualType ToType = AllowRValues? cv1T1 : DestType;
-
const UnresolvedSetImpl *Conversions
= T2RecordDecl->getVisibleConversionFunctions();
for (UnresolvedSetImpl::const_iterator I = Conversions->begin(),
if (ConvTemplate)
S.AddTemplateConversionCandidate(ConvTemplate, I.getPair(),
ActingDC, Initializer,
- ToType, CandidateSet);
+ DestType, CandidateSet);
else
S.AddConversionCandidate(Conv, I.getPair(), ActingDC,
- Initializer, ToType, CandidateSet);
+ Initializer, DestType, CandidateSet);
}
}
}
void test_rvalue_refs() {
// If the initializer expression...
-
// - is an xvalue, class prvalue, array prvalue or function lvalue
// and "cv1 T1" is reference-compatible with "cv2 T2", or
// class prvalue
Base&& base6 = ConvertsTo<Base>();
Base&& base7 = ConvertsTo<Derived>();
-
- // FIXME: function lvalue
- // int (&&function1)(int) = ConvertsTo<int(&)(int)>();
+
+ // function lvalue
+ int (&&function1)(int) = ConvertsTo<int(&)(int)>();
}
class NonCopyable {