Skip to content

Commit 29aa01f

Browse files
committed
Reflection: Don't accidentally copy or assign TypeRefBuilders and ReflectionContexts, NFC
1 parent a3e0b63 commit 29aa01f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

include/swift/Reflection/ReflectionContext.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ class ReflectionContext
9494
explicit ReflectionContext(std::shared_ptr<MemoryReader> reader)
9595
: super(std::move(reader)) {}
9696

97-
ReflectionContext(const ReflectionContext&) = delete;
97+
ReflectionContext(const ReflectionContext &other) = delete;
98+
ReflectionContext &operator=(const ReflectionContext &other) = delete;
9899

99100
MemoryReader &getReader() {
100101
return *this->Reader;

include/swift/Reflection/TypeRefBuilder.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ class TypeRefBuilder {
6969
public:
7070
using Type = const TypeRef *;
7171

72+
TypeRefBuilder() {}
73+
74+
TypeRefBuilder(const TypeRefBuilder &other) = delete;
75+
TypeRefBuilder &operator=(const TypeRefBuilder &other) = delete;
76+
7277
private:
7378
std::vector<std::unique_ptr<const TypeRef>> TypeRefPool;
7479

0 commit comments

Comments
 (0)