Skip to content

Commit 347c2e6

Browse files
authored
[SYCL] Make CollectorLibraryWrapper and BinaryWrapper classes comply with Rule of Three. (#16074)
`CollectorLibraryWrapper` and `BinaryWrapper` had a custom destructor, but no copy constructor and no copy assignment operator, so they were not complying with the Rule of Three. Explicitly add the two latter as deleted to comply.
1 parent 853917d commit 347c2e6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,9 @@ class BinaryWrapper {
13591359
ObjcopyPath = *ObjcopyPathOrErr;
13601360
}
13611361

1362+
BinaryWrapper(const BinaryWrapper &BW) = delete;
1363+
BinaryWrapper &operator=(const BinaryWrapper &BW) = delete;
1364+
13621365
~BinaryWrapper() {
13631366
if (TempFiles.empty())
13641367
return;

sycl/tools/sycl-trace/collector.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class CollectorLibraryWrapper {
4444
public:
4545
CollectorLibraryWrapper(const std::string &LibraryName)
4646
: MLibraryName(LibraryName){};
47+
CollectorLibraryWrapper(const CollectorLibraryWrapper &Other) = delete;
48+
CollectorLibraryWrapper &
49+
operator=(const CollectorLibraryWrapper &Other) = delete;
4750
~CollectorLibraryWrapper() { clear(); };
4851

4952
const std::string InitFuncName = "init";

0 commit comments

Comments
 (0)