[clang-tidy] Make deleted constructor public

Making them private was a way to hide the constructor, 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: I1c037a501c1da39f027c071e5e64d36fd1c95c6d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219419
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68049}
This commit is contained in:
Ng Zhi An 2020-05-27 22:07:17 -07:00 committed by Commit Bot
parent 560a681f34
commit 5a776bc8b2

View File

@ -204,6 +204,10 @@ class HandleScope {
return ::operator new(size, storage);
}
// Prevent heap allocation or illegal handle scopes.
void* operator new(size_t size) = delete;
void operator delete(void* size_t) = delete;
inline ~HandleScope();
inline HandleScope& operator=(HandleScope&& other) V8_NOEXCEPT;
@ -239,10 +243,6 @@ class HandleScope {
static const int kCheckHandleThreshold = 30 * 1024;
private:
// Prevent heap allocation or illegal handle scopes.
void* operator new(size_t size) = delete;
void operator delete(void* size_t) = delete;
Isolate* isolate_;
Address* prev_next_;
Address* prev_limit_;