if(UNIX OR MINGW)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
message(STATUS "Using GCC version ${GCC_VERSION}")
-# disabled because of missing match_partial
-# if(GCC_VERSION VERSION_LESS 4.9)
+ if(GCC_VERSION VERSION_LESS 4.9)
# <regex> in gcc is unusable in versions less than 4.9.0
# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631
set(LYX_USE_STD_REGEX 0)
-# endif()
+ endif()
if (LYX_ENABLE_CXX11)
find_package(CXX11Compiler)
if(NOT CXX11COMPILER_FOUND)
set(LYX_GCC11_MODE "${CXX11_FLAG}")
endif()
else()
-# disabled because of missing match_partial
set(LYX_USE_STD_REGEX 0)
# if(MSVC10)
# set(LYX_USE_STD_REGEX 1) #TODO should we use it in ECMAScript mode?
// <regex> in gcc is unusable in versions less than 4.9.0
// see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53631
// clang defines __GNUC__ but how do the versions match?
-// disabled because of missing match_partial
-//#ifndef LYX_USE_STD_REGEX
-//# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 9) || __GNUC__ > 4 || defined(USE_LLVM_LIBCPP)
-//# define LYX_USE_STD_REGEX
-//# endif
-//#endif
+#ifndef LYX_USE_STD_REGEX
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 9) || __GNUC__ > 4 || defined(USE_LLVM_LIBCPP)
+# define LYX_USE_STD_REGEX
+# endif
+#endif
#ifdef __CYGWIN__
# define NOMINMAX
namespace lyx {
// inheriting 'private' to see which functions are used and if there are
// other ECMAScrip defaults
+ // FIXME: Is this really needed?
+ // If yes, then the MSVC regex implementation is not standard-conforming.
class regex : private std::regex
{
public: