Revert "Revert "Prevent nonsensical comparations between OUString and nullptr_t""
This reverts commit e559c0c9cbfd819f22ef695a9823bb71f4385b58; just turn the deleted overloads into non-friend functions (and rely on any other overloads to be still found via ADL). Change-Id: I2af834162cab2e71ed9e32ae6903bc9f86d77ba2 Reviewed-on: https://gerrit.libreoffice.org/30441 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
@@ -3226,6 +3226,18 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#if defined LIBO_INTERNAL_ONLY
|
||||
// Prevent the operator ==/!= overloads with 'sal_Unicode const *' paramter from
|
||||
// being selected for nonsensical code like
|
||||
//
|
||||
// if (ouIdAttr == nullptr)
|
||||
//
|
||||
void operator ==(OUString const &, std::nullptr_t) = delete;
|
||||
void operator ==(std::nullptr_t, OUString const &) = delete;
|
||||
void operator !=(OUString const &, std::nullptr_t) = delete;
|
||||
void operator !=(std::nullptr_t, OUString const &) = delete;
|
||||
#endif
|
||||
|
||||
#if defined LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
|
||||
/// @cond INTERNAL
|
||||
|
||||
|
Reference in New Issue
Block a user