Steps.push_back(S);
}
-void InitializationSequence::AddUserConversionStep(FunctionDecl *Function) {
+void InitializationSequence::AddUserConversionStep(FunctionDecl *Function,
+ QualType T) {
Step S;
S.Kind = SK_UserConversion;
- S.Type = Function->getResultType().getNonReferenceType();
+ S.Type = T;
S.Function = Function;
Steps.push_back(S);
}
if (OverloadingResult Result
= S.BestViableFunction(CandidateSet, DeclLoc, Best))
return Result;
-
- // Add the user-defined conversion step.
+
FunctionDecl *Function = Best->Function;
- Sequence.AddUserConversionStep(Function);
-
- // Determine whether we need to perform derived-to-base or
- // cv-qualification adjustments.
+
+ // Compute the returned type of the conversion.
if (isa<CXXConversionDecl>(Function))
T2 = Function->getResultType();
else
T2 = cv1T1;
-
+
+ // Add the user-defined conversion step.
+ Sequence.AddUserConversionStep(Function, T2.getNonReferenceType());
+
+ // Determine whether we need to perform derived-to-base or
+ // cv-qualification adjustments.
bool NewDerivedToBase = false;
Sema::ReferenceCompareResult NewRefRelationship
= S.CompareReferenceRelationship(DeclLoc, T1, T2.getNonReferenceType(),
/// \brief Add a new step invoking a conversion function, which is either
/// a constructor or a conversion function.
- void AddUserConversionStep(FunctionDecl *Function);
+ void AddUserConversionStep(FunctionDecl *Function, QualType T);
/// \brief Add a new step that performs a qualification conversion to the
/// given type.
--- /dev/null
+// RUN: clang-cc -emit-llvm-only -verify %s
+
+struct XPTParamDescriptor {};
+struct nsXPTParamInfo {
+ nsXPTParamInfo(const XPTParamDescriptor& desc);
+};
+void a(XPTParamDescriptor *params) {
+ const nsXPTParamInfo& paramInfo = params[0];
+}