Fix a -Wcatch-value warning reported by GCC 8.1
authorLoïc Blot <loic.blot@unix-experience.fr>
Mon, 28 May 2018 12:17:19 +0000 (14:17 +0200)
committerLoïc Blot <loic.blot@unix-experience.fr>
Mon, 28 May 2018 12:17:19 +0000 (14:17 +0200)
```
src/translation.cpp:43:16: warning: interception du type polymorphique « class std::out_of_range » par valeur [-Wcatch-value=]
  } catch (std::out_of_range) {
```·

src/translation.cpp

index 31efca41eaa457a01701800120153d57085b023e..60531be67ee3c14a0265c17b32c15fc828dfac3c 100644 (file)
@@ -40,7 +40,7 @@ const std::wstring &Translations::getTranslation(
        std::wstring key = textdomain + L"|" + s;
        try {
                return m_translations.at(key);
-       } catch (std::out_of_range) {
+       } catch (const std::out_of_range &) {
                warningstream << "Translations: can't find translation for string \""
                              << wide_to_utf8(s) << "\" in textdomain \""
                              << wide_to_utf8(textdomain) << "\"" << std::endl;
@@ -147,4 +147,4 @@ void Translations::loadTranslation(const std::string &data)
 
                m_translations[textdomain + L"|" + oword1] = oword2;
        }
-}
\ No newline at end of file
+}