Commit 2bf94b86 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[clang-tidy] Make deleted member functions public

Making them private was a way to hide them, we can explicitly delete
them, which give a better compilation error message as well.

Also see: https://stackoverflow.com/q/55205874

Bug: v8:10488
Change-Id: I3f2b6881ae2252809c84fbd32ce0687e8328506e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2211182Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67980}
parent dafba0d3
...@@ -47,6 +47,7 @@ std::string ToString(Args&&... args) { ...@@ -47,6 +47,7 @@ std::string ToString(Args&&... args) {
class V8_EXPORT_PRIVATE MessageBuilder { class V8_EXPORT_PRIVATE MessageBuilder {
public: public:
MessageBuilder() = delete;
MessageBuilder(const std::string& message, TorqueMessage::Kind kind); MessageBuilder(const std::string& message, TorqueMessage::Kind kind);
MessageBuilder& Position(SourcePosition position) { MessageBuilder& Position(SourcePosition position) {
...@@ -62,7 +63,6 @@ class V8_EXPORT_PRIVATE MessageBuilder { ...@@ -62,7 +63,6 @@ class V8_EXPORT_PRIVATE MessageBuilder {
} }
private: private:
MessageBuilder() = delete;
void Report() const; void Report() const;
TorqueMessage message_; TorqueMessage message_;
...@@ -370,10 +370,10 @@ class IfDefScope { ...@@ -370,10 +370,10 @@ class IfDefScope {
public: public:
IfDefScope(std::ostream& os, std::string d); IfDefScope(std::ostream& os, std::string d);
~IfDefScope(); ~IfDefScope();
private:
IfDefScope(const IfDefScope&) = delete; IfDefScope(const IfDefScope&) = delete;
IfDefScope& operator=(const IfDefScope&) = delete; IfDefScope& operator=(const IfDefScope&) = delete;
private:
std::ostream& os_; std::ostream& os_;
std::string d_; std::string d_;
}; };
...@@ -383,10 +383,10 @@ class NamespaceScope { ...@@ -383,10 +383,10 @@ class NamespaceScope {
NamespaceScope(std::ostream& os, NamespaceScope(std::ostream& os,
std::initializer_list<std::string> namespaces); std::initializer_list<std::string> namespaces);
~NamespaceScope(); ~NamespaceScope();
private:
NamespaceScope(const NamespaceScope&) = delete; NamespaceScope(const NamespaceScope&) = delete;
NamespaceScope& operator=(const NamespaceScope&) = delete; NamespaceScope& operator=(const NamespaceScope&) = delete;
private:
std::ostream& os_; std::ostream& os_;
std::vector<std::string> d_; std::vector<std::string> d_;
}; };
...@@ -395,10 +395,10 @@ class IncludeGuardScope { ...@@ -395,10 +395,10 @@ class IncludeGuardScope {
public: public:
IncludeGuardScope(std::ostream& os, std::string file_name); IncludeGuardScope(std::ostream& os, std::string file_name);
~IncludeGuardScope(); ~IncludeGuardScope();
private:
IncludeGuardScope(const IncludeGuardScope&) = delete; IncludeGuardScope(const IncludeGuardScope&) = delete;
IncludeGuardScope& operator=(const IncludeGuardScope&) = delete; IncludeGuardScope& operator=(const IncludeGuardScope&) = delete;
private:
std::ostream& os_; std::ostream& os_;
std::string d_; std::string d_;
}; };
...@@ -407,10 +407,10 @@ class IncludeObjectMacrosScope { ...@@ -407,10 +407,10 @@ class IncludeObjectMacrosScope {
public: public:
explicit IncludeObjectMacrosScope(std::ostream& os); explicit IncludeObjectMacrosScope(std::ostream& os);
~IncludeObjectMacrosScope(); ~IncludeObjectMacrosScope();
private:
IncludeObjectMacrosScope(const IncludeObjectMacrosScope&) = delete; IncludeObjectMacrosScope(const IncludeObjectMacrosScope&) = delete;
IncludeObjectMacrosScope& operator=(const IncludeObjectMacrosScope&) = delete; IncludeObjectMacrosScope& operator=(const IncludeObjectMacrosScope&) = delete;
private:
std::ostream& os_; std::ostream& os_;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment