From 003d8508bbd3c92457d929b1300d636d3a6849e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sat, 6 Nov 2021 01:22:38 +0100 Subject: [PATCH] stratosphere: fix static constexpr member variable with incomplete type GCC accepts this for some reason (because of the lambda?) but Clang correctly rejects this. --- .../stratosphere/settings/settings_types.hpp | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libraries/libstratosphere/include/stratosphere/settings/settings_types.hpp b/libraries/libstratosphere/include/stratosphere/settings/settings_types.hpp index a22adcad0..6441fbb33 100644 --- a/libraries/libstratosphere/include/stratosphere/settings/settings_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/settings/settings_types.hpp @@ -71,7 +71,7 @@ namespace ams::settings { } template - static constexpr inline LanguageCode EncodeLanguage = [] { + static constexpr inline LanguageCode EncodeLanguage() { if constexpr (false) { /* ... */ } #define AMS_MATCH_LANGUAGE(lang, enc) else if constexpr (Lang == Language_##lang) { return LanguageCode::Encode(enc); } AMS_MATCH_LANGUAGE(Japanese, "ja") @@ -94,28 +94,28 @@ namespace ams::settings { AMS_MATCH_LANGUAGE(TraditionalChinese, "zh-Hant") #undef AMS_MATCH_LANGUAGE else { static_assert(Lang != Language_Japanese); } - }(); + } static constexpr inline LanguageCode Encode(const Language language) { constexpr LanguageCode EncodedLanguages[Language_Count] = { - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, - EncodeLanguage, + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), + EncodeLanguage(), /* 4.0.0+ */ - EncodeLanguage, - EncodeLanguage, + EncodeLanguage(), + EncodeLanguage(), }; return EncodedLanguages[language]; }