aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #812 from JordanMaples/dev/jomaples/typo_fixesJordan Maples [MSFT]2019-10-032-3/+3
|\ | | | | Fixing typo "Guideline" as "Guidelines"
| * Guideline -> GuidelinesJordan Maples2019-10-022-3/+3
| | | | | | | | fixing issue as reported in issue #746
| * Merge pull request #1 from microsoft/masterJordan Maples [MSFT]2019-08-304-4/+3
| |\ | | | | | | updating from root
* | | Update README.mdJordan Maples [MSFT]2019-09-041-0/+2
| | |
* | | Merge pull request #803 from B1Z0N/masterJordan Maples [MSFT]2019-09-042-2/+6
|\ \ \ | |_|/ |/| | Fixed memory leaks and out of bound access
| * | Merge branch 'master' of https://github.com/B1Z0N/GSLB1Z0N2019-09-014-4/+3
| |\ \ | |/ / |/| |
* | | Merge pull request #769 from jack17529/patch-1Jordan Maples [MSFT]2019-08-151-1/+1
|\ \ \ | | | | | | | | Update usage of difference_type in span
| * | | Update spanJACK_17292019-02-201-1/+1
| | | | | | | | | | | | About my Issue - https://github.com/Microsoft/GSL/issues/765
* | | | Merge pull request #800 from eyalroz/masterJordan Maples [MSFT]2019-08-151-1/+0
|\ \ \ \ | | | | | | | | | | Fixes #798 : Dropping inclusion of `gsl/pointers` in `string_span`
| * | | | Fixes #798 : Dropped inclusion of `gsl/pointers` in `string_span`.Eyal Rozenberg2019-08-051-1/+0
| | |_|/ | |/| |
* | | | Fix GNUC typo (#780)Johel Ernesto Guerrero Peña2019-08-141-1/+1
| | | | | | | | | | | | Resolves #779
* | | | Fixed check if std::byte is available (#764)beinhaerter2019-08-141-1/+1
|/ / / | | | | | | The check for std::byte existance fails on gcc 8.2. According to https://en.cppreference.com/w/cpp/utility/feature_test it is necessary to `#include <cstddef>` before checking `__cpp_lib_byte`.
| | * Fixed memory leaksB1Z0N2019-09-011-0/+4
| | |
| | * Thanks to @stayprivates fixed out of bounds access in "TestNotNullostream"B1Z0N2019-09-011-2/+2
| |/ |/|
* | Add Visual Studio 2019 image for tests (#787)NN2019-06-121-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add Visual Studio 2019 image for tests Refer to https://github.com/appveyor/ci/issues/2907 VS2019 is enabled per request. * Use CMake 3.14 * Fix CMake output directory * trigger build * Trigger build
* | make TypeListIndexer constexpr (#733)Ian Taylor2019-06-061-5/+5
| |
* | add value_type size_type for string_span (#727)Fei Sun2019-04-111-0/+3
|/
* added clang7.0 to Travis configuration and README (#763)Anna Gringauze2019-01-162-1/+27
|
* Clang cl (#762)Anna Gringauze2019-01-1517-106/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Make narrow constexpr (#698)Johel Ernesto Guerrero Peña2019-01-142-0/+13
|
* Dev/annagrin/remove explicit not null constructor (#743)Anna Gringauze2019-01-148-292/+385
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Make CheckRange constexpr (#754) (#755)Alex Green2019-01-141-1/+1
|
* Fixes CMAKE_VERSION check (#759)k-brac2019-01-141-1/+1
| | | | | | | | | | * 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
* Suppress Warnings in GSL Headers (#731)hannesweisbach2018-11-281-5/+15
| | | 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.
* added noexcept to get rid off VC warning con.4 (#748)beinhaerter2018-11-281-1/+1
|
* Fix spelling of library name (#747)Stefan Dinkelacker2018-11-281-2/+2
|
* Use the c++17 constexpr if in CheckRange if possible (#753)kile02018-11-281-0/+4
| | | | | | | | * change c++17 to use constexpr if in CheckRange * remove unnecessary macro * use the portable feature test macro rather than direct version check
* Dev/annagrin/fix span size test gcc (#750)Anna Gringauze2018-11-271-3/+4
| | | | | | * Added c++17 test configurations for clang5.0 and clang6.0 * fixed test for broken span.size() in gcc6.5
* Span can be constructed from empty std::array safely (#686)Dave Hill2018-11-052-10/+26
| | | | | | | | | * 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
* make BoundsRanges constexpr (#732)Ian Taylor2018-11-051-31/+31
| | | | | | | | * make BoundsRanges constexpr * fix clang compilation error * fix windows compilation
* span constructor no address (#723)Anna Gringauze2018-08-192-17/+42
| | | | | | | | | | | | * 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
* better check for branch opt (#724)Anna Gringauze2018-08-191-2/+1
| | | | | | * Added c++17 test configurations for clang5.0 and clang6.0 * Simplified optimization in span::operator[]
* Fix #717 - Add empty() to strided_span (#718)Stephan Dollberg2018-08-172-0/+5
|
* Dev/annagrin/explicit notnull transition description (#722)Anna Gringauze2018-08-171-0/+10
| | | | | | * Added c++17 test configurations for clang5.0 and clang6.0 * Improved description how to make transition to explicit not_null constructor
* Dev/annagrin/opt neg branch (#721)Anna Gringauze2018-08-171-26/+38
| | | | | | | | | | | | * 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
* Dev/annagrin/sloppy not null (#712)Anna Gringauze2018-08-135-10/+254
| | | | | | | | | | * Added c++17 test configurations for clang5.0 and clang6.0 * added transition helper sloppy_not_null * Moved gsl_transition to a samples folder * Fixed build break and static analysis warnings
* Dev/annagrin/make not null (#711)Anna Gringauze2018-08-132-0/+66
| | | | | | | | | | | | | | | | | | | | | * Added c++17 test configurations for clang5.0 and clang6.0 * Added make_not_null helper to create a not_null Introduction of explicit not_null constructor made it cumbersome to create not_nulls in c++14. Adding make_not_null helper. Usage (see tests): int i = 42; auto x = make_not_null(&i); helper(make_not_null(&i)); helper_const(make_not_null(&i)); * Added std::forward to make_not_null, fixed some code analysis warnings * Fix build break in VS2015 Release configuration * Fix build break in VS2015 Release configuration
* fixed typoAnna Gringauze2018-08-121-1/+1
|
* fix cppcorecheck warnings (#703)Anna Gringauze2018-08-1225-503/+940
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added c++17 test configurations for clang5.0 and clang6.0 * Fixed CppCoreCheck warnings in GSL and tests - Added CMakeSettings.json for VS Open Folder configuration - So we can easily run CppCoreCheck in VS - Fixed CppCorecheck warnings where it made sense - Suppressed the rest - Some suppression does not work due to compiler/tool bugs, so replaced by #pragma disable - CppCoreCheck has noise, suppressed those with comments - Catch produces many warnings, blanket-supressed them all - Had to fix clang formatting to keep attributes in place - clang-format does not support attributes, so I am using - "CommentPragmas: '^ NO-FORMAT:'" to skip formatiting on them - Removed GSL_NOEXCEPT macro, removed incorred noexcepts * Ignore unknown attributes * ignore unknown attributes in noexception mode tests * fixed C26472 in at() * created GSL_SUPPRESS macro to allow all compilers to parse suppression attributes * try to fix gcc compilation problems with attributes * ignore gsl::suppress for gcc * move suppression to function level on return statements clang5.0 and up does not allow attributes on return statemets in constexpr functions * move suppression to function level on return statements * use GSL_SUPPRESS in algorithm_tests * Addressed PR comments
* replace uses of GSL_NOEXCEPT macro (#719)Anna Gringauze2018-08-122-246/+229
| | | | | | | | | | | | | | | | * Added c++17 test configurations for clang5.0 and clang6.0 * removed GSL_NOEXCEPT - Removed GSL_NOEXCEPT macro - Replaced by noexcept keyword when needed - removed noexcept where a function could throw * remove unneded undef * fixed replace errors * removed noexcept where function can throw
* Explicitly check for availability of std::byte (fixes #713) (#714)Stefan Reinhold2018-08-031-2/+9
| | | | | | | | | | | * Explicitly check for availbility of std::byte GCC > 7.3 defines __cpp_lib_byte >= 201603 when std::byte is available. On libc++ std::byte is available since version 5.0. This can be checked with _LIBCPP_VERSION >= 5000. This fixes 713. * Add missing \ in preprocessor check
* Suppress warnings on VS (#642)beinhaerter2018-07-312-0/+20
| | | | - gsl::narrow, gsl::narrow_cast and gsl::at are the safe variants suggested by CppCoreGuideline. It does not make sense to let VS warn inside the implementation of these functions that unsafe static_cast is used and that the safe variants shall be used. - Suppress warning that throw_exception can be declared noexcept (for the GSL_TERMINATE_ON_CONTRACT_VIOLATION case)
* Dev/annagrin/failfast in noexcept mode windows (#710)Anna Gringauze2018-07-311-1/+8
| | | | made terminate call __fastfail in noexcept mode when using msvc
* Test broken size (#704)Daniel5992018-07-131-0/+17
| | | | | | | | | | | | * added test for size check (#590) * added #if for gcc 6.4 bug (#590) * hopefully fix #if for gcc 6.4 bug (#590) * fixed CHECK usage (#590) * gcc broken size bug is only when using optimizations
* Added c++17 test configurations for clang5.0 and clang6.0 (#697)Anna Gringauze2018-06-151-7/+12
|
* Added testing for c++17 to latest compilers with test with (#692)Anna Gringauze2018-06-154-41/+86
| | | | | | | | | | | | | | | * Added testing with std=c++17 for latest compilers Added running latest compilers with -std=c++17 option to CI the test matrix, Updated cmake configuration to allow passing c++ standard on the command line. * attempt to fix appveyor break * added clang6.0, removed c++17 tests for clang 5.0 * commented out tests for clang with c++17 die to issue #695 * Addresed comments
* Fix GCC8 warnings 'useless cast to type'. (#691)Matthieu Poullet2018-06-151-2/+2
|
* fix gcc build (gcc 7) (#690)menete2018-06-083-11/+38
| | | simple solution, disable the specific warning
* Added template argument deduction for not_null (#689)Anna Gringauze2018-06-074-4/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added template argument deduction for not_null This allows compilers with c++17 support to infer template instantiation types when calling not_null constructor: int foo(not_null<const int*> x); int main() { int t = 0; not_null x{ &t }; return foo(not_null{ &t }); } * replaced deduction guides by a simple constructor * Updated tests * fixed check for availability of std::byte * testing c++1z on clang * fixed cmakelists extra endif * include cstddef header for clang and gcc in pointers * fixed a typo * fix missing nullptr_t type * fixed typo in CMakeLists.tst * change approach to c++17 testing, step one: revert cmake testing, update clang5.0 package removed using latest c++ due to clang5.0 failing, update clang5.0 travis config to use llvm-toolchain-trusty-5.0 * addressed comments
* Add as_bytes for basic_string_span, fixes issue #655 (#683)beinhaerter2018-05-282-0/+34
|