Skip to content

Commit 9514901

Browse files
authored
Guard against self-assignment; NFC (#145743)
This was caught by a static analysis tool and seemed like a reasonable code quality improvement.
1 parent 21def21 commit 9514901

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

clang/include/clang/AST/Type.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6409,12 +6409,7 @@ class SpirvOperand {
64096409
SpirvOperand(const SpirvOperand &Other) { *this = Other; }
64106410
~SpirvOperand() {}
64116411

6412-
SpirvOperand &operator=(const SpirvOperand &Other) {
6413-
this->Kind = Other.Kind;
6414-
this->ResultType = Other.ResultType;
6415-
this->Value = Other.Value;
6416-
return *this;
6417-
}
6412+
SpirvOperand &operator=(const SpirvOperand &Other) = default;
64186413

64196414
bool operator==(const SpirvOperand &Other) const {
64206415
return Kind == Other.Kind && ResultType == Other.ResultType &&

0 commit comments

Comments
 (0)