Merge "build: require newer CMake"
diff --git a/src/yang_schema.cpp b/src/yang_schema.cpp
index 1dc05db..6370d3b 100644
--- a/src/yang_schema.cpp
+++ b/src/yang_schema.cpp
@@ -253,7 +253,8 @@
                     " is not supported: " +
                     std::to_string(std::underlying_type_t<libyang::LeafBaseType>(leaf->valueType().base())));
         }
-        std::optional<std::string_view> typeDesc;
+        // note https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109434
+        std::optional<std::string> typeDesc;
 
         try {
             typeDesc = type.description();
@@ -261,7 +262,7 @@
             // libyang context doesn't have the parsed info.
         }
 
-        return yang::TypeInfo(resType, std::optional<std::string>{leafUnits}, std::optional<std::string>{typeDesc});
+        return yang::TypeInfo(resType, std::optional<std::string>{leafUnits}, typeDesc);
     };
     return resolveType(leaf->valueType());
 }