Skip to content

Commit 23fc363

Browse files
shafikGeorgeARM
authored andcommitted
[Clang][NFC] Explicitly delete copy ctor and assignment for CGAtomicOptionsRAII (llvm#137275)
Static analysis flagged CGAtomicOptionsRAII as having an explicit destructor but not having explicit copy ctor and assignment. Rule of three says we should. We are just using this as an RAII object, no need for either so they will be specified as deleted.
1 parent eb45272 commit 23fc363

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,9 @@ class CodeGenFunction : public CodeGenTypeCache {
869869
}
870870
CGM.setAtomicOpts(AO);
871871
}
872+
873+
CGAtomicOptionsRAII(const CGAtomicOptionsRAII &) = delete;
874+
CGAtomicOptionsRAII &operator=(const CGAtomicOptionsRAII &) = delete;
872875
~CGAtomicOptionsRAII() { CGM.setAtomicOpts(SavedAtomicOpts); }
873876

874877
private:

0 commit comments

Comments
 (0)