Skip to content

Commit 445b897

Browse files
committed
[Clang][NFC] Explicitly delete copy ctor and assignment for CGAtomicOptionsRAII
Static analysis flagged CGAtomicOptionsRAII as having an explicit destructor but not having explict 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 70e303f commit 445b897

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)