From c5fea3fa514497ffe6dda32714009715ad11eb4e Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 27 Apr 2022 22:28:24 +0000 Subject: [PATCH] Bug 1766549 - Remove some char16ptr_t operators that allow implicit const-casting. r=nika Differential Revision: https://phabricator.services.mozilla.com/D144777 --- mfbt/Char16.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mfbt/Char16.h b/mfbt/Char16.h index b0ba40d0e082..78568808304b 100644 --- a/mfbt/Char16.h +++ b/mfbt/Char16.h @@ -58,13 +58,6 @@ class char16ptr_t { constexpr operator const void*() const { return mPtr; } constexpr explicit operator bool() const { return mPtr != nullptr; } - /* Explicit cast operators to allow things like (char16_t*)str. */ - constexpr explicit operator char16_t*() const { - return const_cast(mPtr); - } - explicit operator wchar_t*() const { - return const_cast(static_cast(*this)); - } explicit operator int() const { return reinterpret_cast(mPtr); } explicit operator unsigned int() const { return reinterpret_cast(mPtr);