Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -40,7 +40,7 @@ option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON) option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) -option(LIBCXX_ENABLE_CXX0X "Enable -std=c++0x and use of c++0x language features if the compiler supports it." ON) +option(LIBCXX_ENABLE_CXX1Y "Enable -std=c++1y and use of c++1y language features if the compiler supports it." ON) option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON) option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON) @@ -194,8 +194,16 @@ list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -nostdinc++) string(REPLACE "-stdlib=libc++" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() - if (LIBCXX_ENABLE_CXX0X AND LIBCXX_HAS_STDCXX0X_FLAG) - list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -std=c++0x) + if (LIBCXX_ENABLE_CXX1Y AND LIBCXX_HAS_STDCXX1Y_FLAG) + set(LIBCXX_STD_VERSION c++1y) + elseif(LIBCXX_HAS_STDCXX11_FLAG) + set(LIBCXX_STD_VERSION c++11) + endif() + + if (DEFINED LIBCXX_STD_VERSION) + list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -std=${LIBCXX_STD_VERSION}) + else() + message(FATAL_ERROR "libc++ requires a standard version >= c++11") endif() endif() Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -2,7 +2,8 @@ include(CheckCXXCompilerFlag) # Check compiler flags -check_cxx_compiler_flag(-std=c++0x LIBCXX_HAS_STDCXX0X_FLAG) +check_cxx_compiler_flag(-std=c++11 LIBCXX_HAS_STDCXX11_FLAG) +check_cxx_compiler_flag(-std=c++1y LIBCXX_HAS_STDCXX1Y_FLAG) check_cxx_compiler_flag(-fPIC LIBCXX_HAS_FPIC_FLAG) check_cxx_compiler_flag(-nodefaultlibs LIBCXX_HAS_NODEFAULTLIBS_FLAG) check_cxx_compiler_flag(-nostdinc++ LIBCXX_HAS_NOSTDINCXX_FLAG) Index: test/lit.cfg =================================================================== --- test/lit.cfg +++ test/lit.cfg @@ -301,8 +301,17 @@ '-I' + libcxx_src_root + '/test/support'] library_paths = ['-L' + libcxx_obj_root + '/lib'] compile_flags = [] -if cxx_has_stdcxx0x_flag: - compile_flags += ['-std=c++0x'] + +# Try and get the std version from the command line. Fall back to default given +# in lit.site.cfg is not present. +std = lit_config.params.get('std', None) +if std is None: + std = getattr(config, 'std', None) + assert std is not None + lit_config.note('inferred std as: \'-std={}\''.format(std)) +else: + lit_config.note('using user specified std: \'-std={}\''.format(std)) +compile_flags += ['-std={}'.format(std)] # Configure extra linker parameters. exec_env = {} Index: test/lit.site.cfg.in =================================================================== --- test/lit.site.cfg.in +++ test/lit.site.cfg.in @@ -1,6 +1,6 @@ @AUTO_GEN_COMMENT@ config.cxx_under_test = "@LIBCXX_COMPILER@" -config.cxx_has_stdcxx0x_flag = @LIBCXX_HAS_STDCXX0X_FLAG@ +config.std = "@LIBCXX_STD_VERSION@" config.libcxx_src_root = "@LIBCXX_SOURCE_DIR@" config.libcxx_obj_root = "@LIBCXX_BINARY_DIR@" config.python_executable = "@PYTHON_EXECUTABLE@"