aboutsummaryrefslogtreecommitdiff
path: root/tests/span_tests.cpp
diff options
context:
space:
mode:
authorAnna Gringauze <annagrin@microsoft.com>2019-01-15 10:27:34 -0800
committerGitHub <noreply@github.com>2019-01-15 10:27:34 -0800
commit6418b5f4de2204cd5a335b00d2f8754301b8b382 (patch)
treea755048982e8389bf9c8610b15ae157f172958f0 /tests/span_tests.cpp
parent6eeed739f1acb81c8b69ceae11bd5f350dab3601 (diff)
downloadMicrosoft-GSL-6418b5f4de2204cd5a335b00d2f8754301b8b382.tar.gz
Clang cl (#762)
* Added c++17 test configurations for clang5.0 and clang6.0 * Fix #739 correct cppcorecheck warnings for clang-cl * Add clang-cl configurations * Corrections Appveyor; Temporarily disable msvc compilation for faster testing (#741) * Add path to clang-cl.exe (#741) * Escape backslash in path (#741) * Update vcpkg (#741) * Check vcpkg version; try without building vcpkg; use latest clang-cl from path (#741) * Fix blocks in ps script (#741) * Try accessing APPVEYOR_BUILD_FOLDER variable (#471) * Update span size() bug confirmation test for GCC 6.5 (#741) * MSVC flags to Clang-cl; disable c++98-compat and undefined macro warnings (#741) * Suppress clang warning on tests (missing-prototypes) (#741) * Fix clang warning -Wnewline-eof (#741) * Fix clang warning -Wdouble-promotion (#741) * Set linker explicitly * Clean condition statement * For Clang, fallback to the AppVeyor installed version of CMake * Fix clang warning -Wmissing-variable-declarations * Fallback to the MSVC linker until vcpkg has been updated * Revert "Fallback to the MSVC linker until vcpkg has been updated" This reverts commit 7263f3289e6e835c32fc7800d0c2d4e58bd21178. * Fix clang warning -Wunused-member-function * Fix clang warning -Wmissing-noreturn * Fix clang warning -Winvalid-noreturn on Windows * Add macro block end comment on large #if blocks * Workaround: fallback to mscv link.exe * Workaround: get msvc paths into PowerShell through intermediate file * Workaround: fix, remove "PATH=" from text * Workaround: try with full-path; and return user PATH * Workaround: fix, escape backslashes * Revert all since "Workaround: fallback to mscv link.exe" did not work on AppVeyor This reverts the commits: bda3d6a428e5d19e97375b2e575b0f51ff1b4bc0 97062933acfb6428535c0fdcab5d94371ce72bfc 0f4fb04bac9c2d091005b791294237250dbe0668 1b0c19afd154f4ffc5ef793014c1bc2324534fd0 a5739ea5f0cd7633527b5e5d3b16a9e3ade7149f * Suppress output of git pull; remove vcpkg from cache * Re-enable AppVeyor builds for all platforms * Correct typo Co-Authored-By: Farwaykorse <Farwaykorse@users.noreply.github.com> * Add Clang-cl 7.0.0 to the supported platforms * Revert "Fix clang warning -Wunused-member-function" This reverts commit 6fe1a4203501145ab4350b9152ecc11f3a30e49a. * Fix or locally suppress clang warning -Wunused-member-function * format touched code and correct comment * git pull --quiet * fix logic error in workaround * fix missing bracket * Suppress output of mkdir * Replace MSBuild with Ninja * Suppress output of 7z * Add architecture flags for Clang * Drop workaround for lld-link * 7-zip Overwrite and Alternative output suppression without suppressing errors Replaces 3c1c0794dd9a29908cc7c38f591bd3c7b4929677 * AppVeyor setup and CMake before build * reorder compiler configuration * remove unnecessary * remove -fno-strict-aliasing * remove -Wsign-conversion, since before v4.0 part of -Wconversion * -Wctor-dtor-privacy is GCC only * remove -Woverloaded-virtual part of -Wmost, part of -Wall * add -Wmissing-noreturn * remove the pragmas for -Wunused-member-function * Re-add MSBuild generator on AppVeyor * Print CMake commands * Add MSBuild toolset selection * Separate Architecture setting * clang-cl: add -Weverything * clang-cl -Wno-c++98-compat * clang-cl -Wno-c++98-compat-pedantic * clang-cl -Wno-missing-prototypes * clang-cl C++14 -Wno-unused-member-function * clang-cl -Wundef __GNUC__ * clang++: add -Weverything * clang++ -Wno-c++98-compat * clang++ -Wno-c++98-compat-pedantic * clang++ -Wno-missing-prototypes * clang++ -Wno-weak-vtables * clang++ C++14 -Wno-unused-member-function * clang++ fix -Wundef _MSC_VER * clang++ -Wno-padded * clang++ solve -Wdeprecated * Add AppleClang compiler target Since CMake v3.0 use of Clang for both is deprecated * clang++ v5.0 C++17 -Wno-undefined-func-template * Add VS2015 + LLVM/clang-cl to AppVeyor * Do not disable constexpr when compiling with clang-cl on Windows * Clean-up clang-only warnings (now under -Weverything) * Revert "Fix clang warning -Winvalid-noreturn on Windows" This reverts commit 2238c4760e86feebb2a18620b77312bd01055f61. * Suppress -Winvalid-noreturn for the MS STL noexception workaround * CMake: put preprocessor definition in target_compile_definitions * Solve compiler warning C4668: __GNUC__ not defined
Diffstat (limited to 'tests/span_tests.cpp')
-rw-r--r--tests/span_tests.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp
index 9637a0e..d22dc08 100644
--- a/tests/span_tests.cpp
+++ b/tests/span_tests.cpp
@@ -37,9 +37,10 @@
#include <type_traits> // for integral_constant<>::value, is_default_co...
#include <vector> // for vector
-namespace gsl {
+namespace gsl
+{
struct fail_fast;
-} // namespace gsl
+} // namespace gsl
using namespace std;
using namespace gsl;
@@ -54,9 +55,12 @@ struct DerivedClass : BaseClass
};
struct AddressOverloaded
{
+#if (__cplusplus > 201402L)
+ [[maybe_unused]]
+#endif
AddressOverloaded operator&() const { return {}; }
};
-}
+} // namespace
GSL_SUPPRESS(con.4) // NO-FORMAT: attribute
TEST_CASE("default_constructor")
@@ -513,8 +517,8 @@ TEST_CASE("from_std_array_constructor")
static span<int> s2;
s2 = s1;
- #if __GNUC__ == 6 && (__GNUC_MINOR__ == 4 || __GNUC_MINOR__ == 5) && __GNUC_PATCHLEVEL__ == 0 && \
- defined(__OPTIMIZE__)
+ #if defined(__GNUC__) && __GNUC__ == 6 && (__GNUC_MINOR__ == 4 || __GNUC_MINOR__ == 5) && \
+ __GNUC_PATCHLEVEL__ == 0 && defined(__OPTIMIZE__)
// Known to be broken in gcc 6.4 and 6.5 with optimizations
// Issue in gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83116
CHECK(s1.size() == 4);