Commit Graph

565 Commits

Author SHA1 Message Date
Daniel Donenfeld
f6d7df0c3b change git add command to add all under asm/. Add secure variable to travis for access token 2019-02-07 12:15:11 -08:00
Daniel Donenfeld
c879ff980c Fix code to handle simulating MSVC case 2019-02-07 11:32:39 -08:00
Daniel Donenfeld
4bb6a2e73e [skip ci] Update ASM for Visual Studio 2017_17_MSVC_x64_Release 2019-02-07 17:58:00 +00:00
Daniel Donenfeld
c32867165e [skip ci] Update ASM for Visual Studio 2017_17_MSVC_x86_Release 2019-02-07 17:53:31 +00:00
Daniel Donenfeld
da2862f0cd [skip ci] Update ASM for Visual Studio 2017_17_MSVC_x64_Debug 2019-02-07 17:49:13 +00:00
Daniel Donenfeld
0a14c48212 [skip ci] Update ASM for Visual Studio 2017_17_MSVC_x86_Debug 2019-02-07 17:45:23 +00:00
Daniel Donenfeld
6c90f89e47 [skip ci] Update ASM for Visual Studio 2017_14_MSVC_x64_Release 2019-02-07 17:42:12 +00:00
Daniel Donenfeld
70d0967c73 [skip ci] Update ASM for Visual Studio 2017_14_MSVC_x86_Release 2019-02-07 17:37:22 +00:00
Daniel Donenfeld
1ac6beb580 [skip ci] Update ASM for Visual Studio 2017_14_MSVC_x64_Debug 2019-02-07 17:32:35 +00:00
Daniel Donenfeld
d45ffafa96 [skip ci] Update ASM for Visual Studio 2017_14_MSVC_x86_Debug 2019-02-07 17:28:26 +00:00
Daniel Donenfeld
8339dfb452 [skip ci] Update ASM for Visual Studio 2015_14_MSVC_x64_Release 2019-02-07 17:19:08 +00:00
Daniel Donenfeld
cabf6480d5 [skip ci] Update ASM for Visual Studio 2015_14_MSVC_x86_Release 2019-02-07 17:15:24 +00:00
Daniel Donenfeld
513300a44e [skip ci] Update ASM for Visual Studio 2015_14_MSVC_x64_Debug 2019-02-07 17:12:30 +00:00
Daniel Donenfeld
b3d01d1942 [skip ci] Update ASM for Visual Studio 2015_14_MSVC_x86_Debug 2019-02-07 17:08:08 +00:00
Daniel Donenfeld
14799ad2fa Merge branch 'master' of https://github.com/dadonenf/GSL 2019-02-07 09:02:59 -08:00
Daniel Donenfeld
daa052491c Fix appveyor.yml to use updated asm location. Revert change to cmake to generate asm with regular test. 2019-02-07 09:00:30 -08:00
Daniel Donenfeld
cfe229474e [skip ci] Update ASM for Visual Studio 2017_17_x64_Release 2019-02-07 02:30:05 +00:00
Daniel Donenfeld
3a6d340fb1 [skip ci] Update ASM for Visual Studio 2017_17_x86_Release 2019-02-07 02:27:08 +00:00
Daniel Donenfeld
d27e0548e3 [skip ci] Update ASM for Visual Studio 2017_17_x64_Debug 2019-02-07 02:24:05 +00:00
Daniel Donenfeld
a008cd7685 [skip ci] Update ASM for Visual Studio 2017_17_x86_Debug 2019-02-07 02:21:19 +00:00
Daniel Donenfeld
5ad5e870eb Merge branch 'master' of https://github.com/dadonenf/GSL 2019-02-06 18:16:21 -08:00
Daniel Donenfeld
c8438976db Merge remote-tracking branch 'upstream/master' 2019-02-06 18:15:51 -08:00
Daniel Donenfeld
7951d9eb51 [skip ci] Update ASM for Visual Studio 2017_14_x86_Release 2019-02-07 02:15:47 +00:00
Daniel Donenfeld
23adf674a3 [skip ci] Update ASM for Visual Studio 2017_14_x64_Debug 2019-02-07 02:12:45 +00:00
Daniel Donenfeld
b38a6cbe08 [skip ci] Update ASM for Visual Studio 2017_14_x86_Debug 2019-02-07 02:10:05 +00:00
Daniel Donenfeld
84213cbb60 [skip ci] Update ASM for Visual Studio 2015_14_x64_Release 2019-02-07 02:07:08 +00:00
Daniel Donenfeld
093e26f365 [skip ci] Update ASM for Visual Studio 2015_14_x86_Release 2019-02-07 02:04:27 +00:00
Daniel Donenfeld
027fd6e0e4 [skip ci] Update ASM for Visual Studio 2015_14_x64_Debug 2019-02-07 02:01:37 +00:00
Daniel Donenfeld
19255eb152 [skip ci] Update ASM for Visual Studio 2015_14_x86_Debug 2019-02-07 01:58:55 +00:00
Daniel Donenfeld
b72e8920ab Add initial work checking in asm from appveyor build into branch 2019-02-06 17:55:42 -08:00
Daniel Donenfeld
6a7f0d44f0 Change asm generation to be on by default. Augment add_gsl_test to generate ASM when requested. 2019-02-06 17:40:57 -08:00
Anna Gringauze
7d78b743e4
added clang7.0 to Travis configuration and README (#763) 2019-01-16 19:58:38 -08:00
Anna Gringauze
6418b5f4de
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 7263f3289e.

* 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:
bda3d6a428
97062933ac
0f4fb04bac
1b0c19afd1
a5739ea5f0

* 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 6fe1a42035.

* 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 3c1c0794dd

* 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 2238c4760e.

* Suppress -Winvalid-noreturn for the MS STL noexception workaround

* CMake: put preprocessor definition in target_compile_definitions

* Solve compiler warning C4668: __GNUC__ not defined
2019-01-15 10:27:34 -08:00
Johel Ernesto Guerrero Peña
6eeed739f1 Make narrow constexpr (#698) 2019-01-14 18:37:37 -08:00
Anna Gringauze
9ff6e19ea9
Dev/annagrin/remove explicit not null constructor (#743)
* Added c++17 test configurations for clang5.0 and clang6.0

* Removed explicit not_null constructor, sloppy_not_null, added strict_not_null

We added explicit not_null constructor in version 2.0.0.
It proved very difficult to switch to the new version for
large code bases that adopted previous versions of gsl,
due to not_null used extensively in the code. Still, using
explicit constructor is very benefitial for new code, since
it encorages better API design and make null checks intentional.

To resolve the issue, this change:
- removes explicit keyword from not_null constructor
- removes unneded sloppy_not_null type
- adds strict_not_null type to behave the same way as v2 not_null
- updates tests

* Removed explicit not_null constructor, sloppy_not_null, added strict_not_null

We added explicit not_null constructor in version 2.0.0.
It proved very difficult to switch to the new version for
large code bases that adopted previous versions of gsl,
due to not_null used extensively in the code. Still, using
explicit constructor is very benefitial for new code, since
it encorages better API design and make null checks intentional.

To resolve the issue, this change:
- removes explicit keyword from not_null constructor
- removes unneded sloppy_not_null type
- adds strict_not_null type to behave the same way as v2 not_null
- updates tests

* fixed build break for gcc7

* added more tests

* added more non-compiling tests

* Addressed PR comments and suppressed a code analysis warning

* Fixed test failure in not_null tests
2019-01-14 16:45:47 -08:00
Alex Green
7a7d025ffa Make CheckRange constexpr (#754) (#755) 2019-01-14 16:44:45 -08:00
k-brac
be3c3c2731 Fixes CMAKE_VERSION check (#759)
* Fixes CMAKE_VERSION check

Fixes #758 by using the correct comparison operator for a version
See documentation at https://cmake.org/cmake/help/latest/command/if.html
Thanks to this change, gsl natvis is properly included in a visual studio solution

* cmake version check for cmake < 3.7
2019-01-14 16:43:17 -08:00
Daniel Donenfeld
346093c99e Add asm generation target (off by default) and function to add a test to generate asm. Add existing span test to set of asm tests. (Note: this commit does not change any CI system or introduce any automatic diffing) 2018-12-06 11:47:52 -08:00
hannesweisbach
0f68d133fa Suppress Warnings in GSL Headers (#731)
Suppress warnings in GSL headers using the SYSTEM keyword for target_include_directories(). This enables developers to see warnings standalone builds but hides them from users in non-standalone builds.
2018-11-28 15:37:59 -08:00
beinhaerter
88aca1caf3 added noexcept to get rid off VC warning con.4 (#748) 2018-11-28 11:57:43 -08:00
Stefan Dinkelacker
2e4d0d7e22 Fix spelling of library name (#747) 2018-11-28 11:53:38 -08:00
kile0
5a7093f983 Use the c++17 constexpr if in CheckRange if possible (#753)
* change c++17 to use constexpr if in CheckRange

* remove unnecessary macro

* use the portable feature test macro rather than direct version check
2018-11-28 11:52:11 -08:00
Anna Gringauze
b673375719
Dev/annagrin/fix span size test gcc (#750)
* Added c++17 test configurations for clang5.0 and clang6.0

* fixed test for broken span.size() in gcc6.5
2018-11-27 17:28:57 -08:00
Dave Hill
c02ddae4bc Span can be constructed from empty std::array safely (#686)
* Span std::array c'tor uses arr.data() instead of &arr[0]
- Fixes runtime issues when constructing from an empty std::array

* Construct span with std::data if C++17 detected

* Specialize span c'tor for std::array of length 0, set storage to nullptr
2018-11-05 15:39:41 -08:00
Ian Taylor
2bf9f137a6 make BoundsRanges constexpr (#732)
* make BoundsRanges constexpr

* fix clang compilation error

* fix windows compilation
2018-11-05 15:26:27 -08:00
Anna Gringauze
1995e86d1a span constructor no address (#723)
* Changed &arr[0] to std::array<T, N>::data and std::address_of to protect against overloaded operator&.

* Removed the usage of `std::addressof` because it is a C++ 17 feature. Using decay for C arrays instead.

* Add unit tests for #662.

* Added c++17 test configurations for clang5.0 and clang6.0

* fixed CppCoreCheck pointer decay warning
2018-08-19 17:10:53 -07:00
Anna Gringauze
585f48ce55 better check for branch opt (#724)
* Added c++17 test configurations for clang5.0 and clang6.0

* Simplified optimization in span::operator[]
2018-08-19 16:27:30 -07:00
Stephan Dollberg
86be2366c7 Fix #717 - Add empty() to strided_span (#718) 2018-08-17 11:47:03 -07:00
Anna Gringauze
55aad0ab6d
Dev/annagrin/explicit notnull transition description (#722)
* Added c++17 test configurations for clang5.0 and clang6.0

* Improved description how to make transition to explicit not_null constructor
2018-08-17 11:36:26 -07:00
Anna Gringauze
5016ce4a4d
Dev/annagrin/opt neg branch (#721)
* Added c++17 test configurations for clang5.0 and clang6.0

* Added optimization that removes a branch from span::operator[]

* minor beauty fix

* added a better message for the optimization, fixed signed/unsigned warning

* better check fir wrap-around possibility
2018-08-17 11:36:06 -07:00