Bug 1924278 - Remove whitespace in literal operator declarations. r=nika

That form has been deprecated, and clang trunk now complains about it.
See https://cplusplus.github.io/CWG/issues/2521.html

Differential Revision: https://phabricator.services.mozilla.com/D225560
This commit is contained in:
Mike Hommey 2024-10-15 19:51:42 +00:00
parent 6db32077dd
commit 8aedb008df
2 changed files with 6 additions and 6 deletions

View File

@ -16,19 +16,19 @@
//
// size_t page_size = 4_KiB;
//
constexpr size_t operator"" _KiB(unsigned long long int aNum) {
constexpr size_t operator""_KiB(unsigned long long int aNum) {
return size_t(aNum) * 1024;
}
constexpr size_t operator"" _KiB(long double aNum) {
constexpr size_t operator""_KiB(long double aNum) {
return size_t(aNum * 1024);
}
constexpr size_t operator"" _MiB(unsigned long long int aNum) {
constexpr size_t operator""_MiB(unsigned long long int aNum) {
return size_t(aNum) * 1024_KiB;
}
constexpr size_t operator"" _MiB(long double aNum) {
constexpr size_t operator""_MiB(long double aNum) {
return size_t(aNum * 1024_KiB);
}

View File

@ -91,8 +91,8 @@ class nsTLiteralString : public mozilla::detail::nsTStringRepr<T> {
// any non-private use of that constructor would get into the codebase.
#if defined(__clang__)
private:
friend constexpr auto operator"" _ns(const char* aStr, std::size_t aLen);
friend constexpr auto operator"" _ns(const char16_t* aStr, std::size_t aLen);
friend constexpr auto operator""_ns(const char* aStr, std::size_t aLen);
friend constexpr auto operator""_ns(const char16_t* aStr, std::size_t aLen);
#else
public:
#endif