Commit 28333c85 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

Fix GCC's "only here as ‘friend’" warning about swap()

The compiler warning reads:
warning: ‘void KDevelop::swap(KDevelop::IndexedString&, KDevelop::IndexedString&)’ has not been declared within ‘KDevelop’
  306 | void KDevelop::swap(IndexedString& a, IndexedString& b) noexcept
note: only here as a ‘friend’
  170 |     friend KDEVPLATFORMSERIALIZATION_EXPORT void swap(IndexedString&, IndexedString&) noexcept;

A relevant Stack Overflow question:
https://stackoverflow.com/questions/44749878/warning-defining-friend-operator-declared-inside-a-namespace
parent c3d9ca6b
Pipeline #126797 passed with stage
in 32 minutes and 25 seconds
......@@ -303,7 +303,8 @@ IndexedString& IndexedString::operator=(const IndexedString& rhs) noexcept
return *this;
}
void KDevelop::swap(IndexedString& a, IndexedString& b) noexcept
namespace KDevelop {
void swap(IndexedString& a, IndexedString& b) noexcept
{
using std::swap;
......@@ -327,6 +328,7 @@ void KDevelop::swap(IndexedString& a, IndexedString& b) noexcept
deref(noLongerRefCountedIndex);
ref(newlyRefCountedIndex);
}
}
QUrl IndexedString::toUrl() const
{
......
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