Skip to content

Commit cb9a9a2

Browse files
authored
enabled and fixed modernize-use-equals-delete clang-tidy warnings (#565)
1 parent a74ed72 commit cb9a9a2

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Checks: >
3131
-modernize-pass-by-value,
3232
-modernize-return-braced-init-list,
3333
-modernize-use-auto,
34-
-modernize-use-equals-delete,
3534
-modernize-use-nodiscard,
3635
-modernize-use-trailing-return-type,
3736
-readability-avoid-nested-conditional-operator,

simplecpp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,9 @@ class FileStream : public simplecpp::TokenList::Stream {
427427
init();
428428
}
429429

430+
FileStream(const FileStream&) = delete;
431+
FileStream &operator=(const FileStream&) = delete;
432+
430433
~FileStream() override {
431434
fclose(file);
432435
file = nullptr;
@@ -459,9 +462,6 @@ class FileStream : public simplecpp::TokenList::Stream {
459462
ungetc(ch, file);
460463
}
461464

462-
FileStream(const FileStream&);
463-
FileStream &operator=(const FileStream&);
464-
465465
FILE *file;
466466
int lastCh{};
467467
int lastStatus{};

simplecpp.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ namespace simplecpp {
130130
Token(const Token &tok) :
131131
macro(tok.macro), op(tok.op), comment(tok.comment), name(tok.name), number(tok.number), whitespaceahead(tok.whitespaceahead), location(tok.location), string(tok.string), mExpandedFrom(tok.mExpandedFrom) {}
132132

133+
Token &operator=(const Token &tok) = delete;
134+
133135
const TokenString& str() const {
134136
return string;
135137
}
@@ -195,9 +197,6 @@ namespace simplecpp {
195197
TokenString string;
196198

197199
std::set<const Macro*> mExpandedFrom;
198-
199-
// Not implemented - prevent assignment
200-
Token &operator=(const Token &tok);
201200
};
202201

203202
/** Output from preprocessor */

0 commit comments

Comments
 (0)