|
16 | 16 | #include "ModuleFormat.h" |
17 | 17 | #include "swift/AST/ASTContext.h" |
18 | 18 | #include "swift/AST/Attr.h" |
| 19 | +#include "swift/AST/AttrKind.h" |
19 | 20 | #include "swift/AST/AutoDiff.h" |
20 | 21 | #include "swift/AST/DiagnosticsSema.h" |
21 | 22 | #include "swift/AST/Expr.h" |
|
24 | 25 | #include "swift/AST/GenericEnvironment.h" |
25 | 26 | #include "swift/AST/Initializer.h" |
26 | 27 | #include "swift/AST/NameLookupRequests.h" |
27 | | -#include "swift/AST/Pattern.h" |
28 | 28 | #include "swift/AST/ParameterList.h" |
| 29 | +#include "swift/AST/Pattern.h" |
29 | 30 | #include "swift/AST/PrettyStackTrace.h" |
30 | 31 | #include "swift/AST/PropertyWrappers.h" |
31 | 32 | #include "swift/AST/ProtocolConformance.h" |
32 | 33 | #include "swift/AST/TypeCheckRequests.h" |
| 34 | +#include "swift/Basic/Defer.h" |
| 35 | +#include "swift/Basic/Statistic.h" |
33 | 36 | #include "swift/ClangImporter/ClangImporter.h" |
34 | 37 | #include "swift/ClangImporter/ClangModule.h" |
35 | 38 | #include "swift/ClangImporter/SwiftAbstractBasicReader.h" |
36 | 39 | #include "swift/Serialization/SerializedModuleLoader.h" |
37 | | -#include "swift/Basic/Defer.h" |
38 | | -#include "swift/Basic/Statistic.h" |
39 | 40 | #include "clang/AST/DeclTemplate.h" |
40 | 41 | #include "llvm/ADT/Statistic.h" |
41 | 42 | #include "llvm/Support/Compiler.h" |
@@ -5131,6 +5132,17 @@ llvm::Error DeclDeserializer::deserializeDeclCommon() { |
5131 | 5132 | MF.fatal(llvm::make_error<InvalidRecordKindError>(recordID)); |
5132 | 5133 | } |
5133 | 5134 |
|
| 5135 | + // Do a quick check to see if this attribute is a move only attribute. If |
| 5136 | + // so, emit a nice error if we don't have experimental move only enabled. |
| 5137 | + if (Attr->getKind() == DeclAttrKind::DAK_MoveOnly && |
| 5138 | + !MF.getContext().LangOpts.Features.contains(Feature::MoveOnly)) { |
| 5139 | + MF.getContext().Diags.diagnose( |
| 5140 | + SourceLoc(), |
| 5141 | + diag:: |
| 5142 | + experimental_moveonly_feature_can_only_be_imported_when_enabled, |
| 5143 | + MF.getAssociatedModule()->getName()); |
| 5144 | + } |
| 5145 | + |
5134 | 5146 | if (!skipAttr) { |
5135 | 5147 | if (!Attr) |
5136 | 5148 | return llvm::Error::success(); |
|
0 commit comments