diff --git a/.travis.yml b/.travis.yml index e6282ab..9b21781 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,10 @@ stages: - name: Legacy # build with all other supported compilers jobs: + fast_finish: true + allow_failures: + - stage: Legacy + include: ########################################################################## @@ -111,6 +115,7 @@ jobs: # Xcode 10.1 - name: AppleClang Xcode-10.1 C++14 Debug + stage: Latest env: BUILD_TYPE=Debug GSL_CXX_STANDARD=14 os: osx osx_image: xcode10.1 # AppleClang 10.0.0 same compiler as Xcode 10.0 @@ -147,7 +152,6 @@ jobs: # Xcode 11.3 - name: AppleClang Xcode-11.3 C++17 Debug - stage: Latest env: BUILD_TYPE=Debug GSL_CXX_STANDARD=17 os: osx osx_image: xcode11.3 # AppleClang 11.0.0 linker update / same as Xcode 11.2 @@ -296,6 +300,7 @@ jobs: # Clang 9 - name: Clang-9 C++14 Debug + stage: Latest env: CXX=clang++-9 BUILD_TYPE=Debug GSL_CXX_STANDARD=14 addons: &clang9 apt: @@ -316,7 +321,6 @@ jobs: # Clang 10 - name: Clang-10 C++14 Debug - stage: Latest env: CXX=clang++-10 BUILD_TYPE=Debug GSL_CXX_STANDARD=14 addons: &clang10 apt: @@ -370,6 +374,7 @@ jobs: # GCC 8 - name: GCC-8 C++14 Debug + stage: Latest env: CXX=g++-8 BUILD_TYPE=Debug GSL_CXX_STANDARD=14 addons: &gcc8 apt: @@ -386,7 +391,6 @@ jobs: # GCC 9 - name: GCC-9 C++14 Debug - stage: Latest env: CXX=g++-9 BUILD_TYPE=Debug GSL_CXX_STANDARD=14 addons: &gcc9 apt: @@ -538,7 +542,7 @@ before_script: - | cd "${TRAVIS_BUILD_DIR:?}" mkdir build && cd build - if [[ ${GSL_CXX_STANDARD:-} ]]; then + if [[ ${GSL_CXX_STANDARD:-} ]]; then CMAKE_GEN_FLAGS=("-DGSL_CXX_STANDARD=$GSL_CXX_STANDARD") fi CMAKE_GEN_FLAGS+=("-Wdev -Werror=dev --warn-uninitialized") diff --git a/README.md b/README.md index f4d4e02..39fdf8a 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,18 @@ This project makes use of the [Google Test](https://github.com/google/googletest # Quick Start ## Supported Platforms -The test suite that exercises GSL has been built and passes successfully on the following platforms:1) +The GSL officially supports the current and previous major releases of MSVC, GCC, Clang, and XCode's AppleClang. +See our latest test results for the most up-to-date list of supported configurations. 1) + +- For XCode, Clang, and GCC: [![Build Status](https://travis-ci.org/Microsoft/GSL.svg?branch=master)](https://travis-ci.org/Microsoft/GSL) +- For Visual Studio with MSVC and LLVM toolsets: [![Build status](https://ci.appveyor.com/api/projects/status/github/Microsoft/GSL?svg=true)](https://ci.appveyor.com/project/neilmacintosh/GSL) +- Android and iOS support: ![CI](https://github.com/microsoft/GSL/workflows/CI/badge.svg) 2) + + +The test suite that exercises GSL has been built and passes successfully on the following platforms: 3) -* Windows using Visual Studio 2015 * Windows using Visual Studio 2017 +* Windows using Visual Studio 2019 * Windows using Clang/LLVM 3.6 * Windows using Clang/LLVM 7.0.0 * Windows using GCC 5.1 @@ -50,7 +58,9 @@ The test suite that exercises GSL has been built and passes successfully on the > If you successfully port GSL to another platform, we would love to hear from you. Please submit an issue to let us know. Also please consider contributing any changes that were necessary back to this project to benefit the wider community. -1) For `gsl::byte` to work correctly with Clang and GCC you might have to use the ` -fno-strict-aliasing` compiler option. +1) The test matrix contains legacy versions of these compilers. The legacy releases are no longer officially supported. If a change causes a legacy compiler to fail, please file an issue or submit a pull request to have the legacy version to be removed from the test matrix. +2) Android and iOS build failures are non-blocking and do not prevent pull request merging. +3) For `gsl::byte` to work correctly with Clang and GCC you might have to use the ` -fno-strict-aliasing` compiler option. ## Building the tests To build the tests, you will require the following: diff --git a/appveyor.yml b/appveyor.yml index 6feaf7c..f0c686b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,7 +9,6 @@ configuration: - Release image: - - Visual Studio 2015 - Visual Studio 2017 - Visual Studio 2019 @@ -17,7 +16,6 @@ environment: NINJA_TAG: v1.8.2 NINJA_SHA512: 9B9CE248240665FCD6404B989F3B3C27ED9682838225E6DC9B67B551774F251E4FF8A207504F941E7C811E7A8BE1945E7BCB94472A335EF15E23A0200A32E6D5 NINJA_PATH: C:\Tools\ninja\ninja-%NINJA_TAG% - VCVAR2015: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat' VCVAR2017: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat' VCVAR2019: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat' matrix: @@ -34,14 +32,6 @@ environment: USE_TOOLSET: LLVM USE_GENERATOR: Ninja -matrix: - exclude: - - image: Visual Studio 2015 - GSL_CXX_STANDARD: 17 - - image: Visual Studio 2015 - USE_TOOLSET: LLVM - USE_GENERATOR: MSBuild - cache: - C:\cmake-3.14.4-win32-x86 - C:\Tools\ninja @@ -72,9 +62,7 @@ before_build: if ("$env:USE_GENERATOR" -eq "Ninja") { $GeneratorFlags = '-k 10' $Architecture = $env:PLATFORM - if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2015") { - $env:VCVARSALL = "`"$env:VCVAR2015`" $Architecture" - } elseif ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2017") { + if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2017") { $env:VCVARSALL = "`"$env:VCVAR2017`" $Architecture" } else { $env:VCVARSALL = "`"$env:VCVAR2019`" $Architecture" @@ -82,17 +70,15 @@ before_build: $env:CMakeGenFlags = "-G Ninja -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD" } else { $GeneratorFlags = '/m /v:minimal' - if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2015") { - $Generator = 'Visual Studio 14 2015' - } elseif ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2017") { + if ("$env:APPVEYOR_BUILD_WORKER_IMAGE" -eq "Visual Studio 2017") { $Generator = 'Visual Studio 15 2017' } else { $Generator = 'Visual Studio 16 2019' } - if ("$env:PLATFORM" -eq "x86") { + if ("$env:PLATFORM" -eq "x86") { $Architecture = "Win32" - } else { - $Architecture = "x64" + } else { + $Architecture = "x64" } if ("$env:USE_TOOLSET" -eq "LLVM") { $env:CMakeGenFlags = "-G `"$Generator`" -A $Architecture -T llvm -DGSL_CXX_STANDARD=$env:GSL_CXX_STANDARD" diff --git a/include/gsl/gsl_util b/include/gsl/gsl_util index bc65923..d4f5563 100644 --- a/include/gsl/gsl_util +++ b/include/gsl/gsl_util @@ -30,18 +30,8 @@ #pragma warning(push) #pragma warning(disable : 4127) // conditional expression is constant -#if _MSC_VER < 1910 -#pragma push_macro("constexpr") -#define constexpr /*constexpr*/ -#endif // _MSC_VER < 1910 #endif // _MSC_VER -#if (defined(_MSC_VER) && _MSC_VER < 1910) || (!defined(__clang__) && defined(__GNUC__) && __GNUC__ < 6) -#define GSL_CONSTEXPR_NARROW 0 -#else -#define GSL_CONSTEXPR_NARROW 1 -#endif - namespace gsl { // @@ -113,9 +103,7 @@ namespace details template GSL_SUPPRESS(type.1) // NO-FORMAT: attribute GSL_SUPPRESS(f.6) // NO-FORMAT: attribute // TODO: MSVC /analyze does not recognise noexcept(false) -#if GSL_CONSTEXPR_NARROW constexpr -#endif T narrow(U u) noexcept(false) { T t = narrow_cast(u); @@ -158,11 +146,6 @@ constexpr T at(const std::initializer_list cont, const index i) } // namespace gsl #if defined(_MSC_VER) && !defined(__clang__) -#if _MSC_VER < 1910 -#undef constexpr -#pragma pop_macro("constexpr") - -#endif // _MSC_VER < 1910 #pragma warning(pop) diff --git a/include/gsl/span b/include/gsl/span index e326446..c2c7a8f 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -38,12 +38,6 @@ #pragma warning(disable : 26495) // uninitalized member when constructor calls constructor #pragma warning(disable : 26446) // parser bug does not allow attributes on some templates -#if _MSC_VER < 1910 -#pragma push_macro("constexpr") -#define constexpr /*constexpr*/ -#define GSL_USE_STATIC_CONSTEXPR_WORKAROUND - -#endif // _MSC_VER < 1910 #endif // _MSC_VER // See if we have enough C++17 power to use a static constexpr data member @@ -748,11 +742,6 @@ as_writable_bytes(span s) noexcept } // namespace gsl #if defined(_MSC_VER) && !defined(__clang__) -#if _MSC_VER < 1910 -#undef constexpr -#pragma pop_macro("constexpr") - -#endif // _MSC_VER < 1910 #pragma warning(pop) #endif // _MSC_VER diff --git a/include/gsl/string_span b/include/gsl/string_span index b96c9ff..2ece81f 100644 --- a/include/gsl/string_span +++ b/include/gsl/string_span @@ -36,11 +36,6 @@ #pragma warning(disable : 26446) // TODO: bug in parser - attributes and templates #pragma warning(disable : 26481) // TODO: suppress does not work inside templates sometimes -#if _MSC_VER < 1910 -#pragma push_macro("constexpr") -#define constexpr /*constexpr*/ - -#endif // _MSC_VER < 1910 #endif // _MSC_VER namespace gsl @@ -706,11 +701,6 @@ bool operator>=(const T& one, gsl::basic_string_span other) #if defined(_MSC_VER) && !defined(__clang__) #pragma warning(pop) -#if _MSC_VER < 1910 -#undef constexpr -#pragma pop_macro("constexpr") - -#endif // _MSC_VER < 1910 #endif // _MSC_VER #endif // GSL_STRING_SPAN_H