FunctionDecl *Fn = Step->Function.Function;
DeclAccessPair FoundFn = Step->Function.FoundDecl;
bool CreatedObject = false;
- bool IsLvalue = false;
if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(Fn)) {
// Build a call to the selected constructor.
ASTOwningVector<Expr*> ConstructorArgs(S);
} else {
// Build a call to the conversion function.
CXXConversionDecl *Conversion = cast<CXXConversionDecl>(Fn);
- IsLvalue = Conversion->getResultType()->isLValueReferenceType();
S.CheckMemberOperatorAccess(Kind.getLocation(), CurInit.get(), 0,
FoundFn);
S.DiagnoseUseOfDecl(FoundFn, Kind.getLocation());
}
}
- // FIXME: xvalues
CurInit = S.Owned(ImplicitCastExpr::Create(S.Context,
CurInit.get()->getType(),
CastKind, CurInit.get(), 0,
- IsLvalue ? VK_LValue : VK_RValue));
+ CurInit.get()->getValueKind()));
if (RequiresCopy)
CurInit = CopyObject(S, Entity.getType().getNonReferenceType(), Entity,
else // Construction from different type can't be elided
return i; // expected-error {{no viable conversion from 'int' to 'MoveOnly'}}
}
+
+// PR11009
+struct MoveConvertible {
+ operator int&& () const;
+};
+void moveConstruct() {
+ (void)(int)MoveConvertible();
+}