Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class ClangTidyContext {

~ClangTidyContext();

ClangTidyContext(const ClangTidyContext &) = default;
ClangTidyContext &operator=(const ClangTidyContext &) = default;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these would make more sense as = delete; so that we prevent accidental copies of the context object. (We want this passed around by reference or pointer only.)


/// Report any errors detected using this method.
///
/// This is still under heavy development and will likely change towards using
Expand Down
2 changes: 2 additions & 0 deletions clang-tools-extra/clang-tidy/NoLintDirectiveHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class NoLintDirectiveHandler {
public:
NoLintDirectiveHandler();
~NoLintDirectiveHandler();
NoLintDirectiveHandler(const NoLintDirectiveHandler &) = default;
NoLintDirectiveHandler &operator=(const NoLintDirectiveHandler &) = default;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these are strictly needed, but I think it would be fine to explicitly = delete them.


bool shouldSuppress(DiagnosticsEngine::Level DiagLevel,
const Diagnostic &Diag, llvm::StringRef DiagName,
Expand Down
3 changes: 3 additions & 0 deletions clang-tools-extra/clangd/ClangdLSPServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ class ClangdLSPServer : private ClangdServer::Callbacks,
/// The destructor blocks on any outstanding background tasks.
~ClangdLSPServer();

ClangdLSPServer(const ClangdLSPServer &other) = default;
ClangdLSPServer &operator=(const ClangdLSPServer &other) = default;

/// Run LSP server loop, communicating with the Transport provided in the
/// constructor. This method must not be executed more than once.
///
Expand Down
3 changes: 3 additions & 0 deletions clang-tools-extra/clangd/ParsedAST.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class ParsedAST {

~ParsedAST();

ParsedAST(const ParsedAST &Other) = default;
ParsedAST &operator=(const ParsedAST &Other) = default;

/// Note that the returned ast will not contain decls from the preamble that
/// were not deserialized during parsing. Clients should expect only decls
/// from the main file to be in the AST.
Expand Down
6 changes: 5 additions & 1 deletion clang-tools-extra/clangd/TUScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ class PreambleThrottlerRequest {
if (Throttler)
Throttler->release(ID);
}
PreambleThrottlerRequest(const PreambleThrottlerRequest &) = default;
PreambleThrottlerRequest &
operator=(const PreambleThrottlerRequest &) = default;

private:
PreambleThrottler::RequestID ID;
Expand Down Expand Up @@ -621,7 +624,8 @@ class ASTWorker {
AsyncTaskRunner *Tasks, Semaphore &Barrier,
const TUScheduler::Options &Opts, ParsingCallbacks &Callbacks);
~ASTWorker();

ASTWorker(const ASTWorker &other) = default;
ASTWorker &operator=(const ASTWorker &other) = default;
void update(ParseInputs Inputs, WantDiagnostics, bool ContentChanged);
void
runWithAST(llvm::StringRef Name,
Expand Down
3 changes: 3 additions & 0 deletions clang-tools-extra/clangd/TUScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ class TUScheduler {
std::unique_ptr<ParsingCallbacks> ASTCallbacks = nullptr);
~TUScheduler();

TUScheduler(const TUScheduler &other) = default;
TUScheduler &operator=(const TUScheduler &other) = default;

struct FileStats {
std::size_t UsedBytesAST = 0;
std::size_t UsedBytesPreamble = 0;
Expand Down
3 changes: 3 additions & 0 deletions clang-tools-extra/clangd/support/DirectiveTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ class Preprocessor {
Preprocessor(const TokenStream &In, TokenStream &Out) : In(In), Out(Out) {}
~Preprocessor() { Out.finalize(); }

Preprocessor(const Preprocessor &other) = default;
Preprocessor &operator=(const Preprocessor &other) = default;

void walk(const DirectiveTree &T) {
for (const auto &C : T.Chunks)
std::visit(*this, C);
Expand Down
2 changes: 2 additions & 0 deletions clang-tools-extra/modularize/ModuleAssistant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class Module {
public:
Module(llvm::StringRef Name, bool Problem);
~Module();
Module(const Module &other) = default;
Module &operator=(const Module &other) = default;
bool output(llvm::raw_fd_ostream &OS, int Indent);
Module *findSubModule(llvm::StringRef SubName);

Expand Down
Loading