Skip to content

Commit 7477c23

Browse files
committed
[Sema] allow '@_moveOnly' class with feature flag
1 parent 831b27e commit 7477c23

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,9 @@ bool HasNoncopyableAnnotationRequest::evaluate(Evaluator &evaluator, TypeDecl *d
944944

945945
// Handle the legacy '@_moveOnly' attribute
946946
if (decl->getAttrs().hasAttribute<MoveOnlyAttr>()) {
947-
assert(isa<StructDecl>(decl) || isa<EnumDecl>(decl));
947+
assert(isa<StructDecl>(decl) || isa<EnumDecl>(decl)
948+
|| (ctx.LangOpts.hasFeature(Feature::MoveOnlyClasses)
949+
&& isa<ClassDecl>(decl)));
948950
return true;
949951
}
950952

0 commit comments

Comments
 (0)