Commit Graph

23 Commits

Author SHA1 Message Date
Xiang Fan
95f8f74a2c Enable building boost.hana with VS2107 15.8 (with five source workarounds)
Here is the test result:

 100% tests passed, 0 tests failed out of 1103

Here are the details of the source workarounds:

 1. Active issues we are working on
 a. Multiple copy/move ctors
 VC doesn't correctly handle multiple copy/move ctors.
 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_MULTIPLECTOR_106654.

 b. Forward declaration of class template member function returning decltype(auto) (this issue is exposed by a recent change in boost 1.68)
 To deduce the actual return type, the compiler expects the function definition to be on the pending list for temploid, which isn't always the case when generic lambda is involved.
 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_DECLTYPEAUTO_RETURNTYPE_662735

 2. Issues fixed in the development branch of MSVC
 Parsing template id
 VC sometimes incorrectly parses a comparison operation as a template id.
 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_RDPARSER_TEMPLATEID_616568.

 3. Issues fixed conditionally
 a. Empty base optimization
 VC doesn't always do EBO (empty base optimization). Changing this will break the ABI of MSVC and we provide a __declspec(empty_bases) to enable EBO.
 We have a blog post on this: https://blogs.msdn.microsoft.com/vcblog/2016/03/30/optimizing-the-layout-of-empty-base-classes-in-vs2015-update-2-3/.
 Some tests in hana have static_assert on the size of certain types which relies on EBO being applied:

 hana\test\detail\ebo.cpp
 hana\test\issues\github_202.cpp
 hana\test\pair\empty_storage.cpp
 hana\test\tuple\empty_member.cpp

 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_EMPTYBASE.

 b. Variadic macro expansion
 The implementation of variadic macro isn't conformant and the macro expansion often results in incorrect result.
 The issue is fixed under /experimental:preprocessor and isn't on by default yet.
 We have a blog post on this: https://blogs.msdn.microsoft.com/vcblog/2018/07/06/msvc-preprocessor-progress-towards-conformance/.

 The workaround is under macro BOOST_HANA_WORKAROUND_MSVC_PREPROCESSOR_616033.

Here is the list of files impacted by the source workarounds:

 BOOST_HANA_WORKAROUND_MSVC_MULTIPLECTOR_106654
  hana\test\_include\laws\base.hpp
  hana\test\map\cnstr.trap.cpp
  hana\test\set\cnstr.trap.cpp
  hana\test\tuple\cnstr.trap.cpp

 BOOST_HANA_WORKAROUND_MSVC_DECLTYPEAUTO_RETURNTYPE_662735
  hana\test\_include\laws\euclidean_ring.hpp
  hana\test\_include\laws\group.hpp
  hana\test\_include\laws\monad_plus.hpp
  hana\test\_include\laws\monoid.hpp
  hana\test\_include\laws\ring.hpp

 BOOST_HANA_WORKAROUND_MSVC_RDPARSER_TEMPLATEID_616568
  hana\include\boost\hana\basic_tuple.hpp
  hana\include\boost\hana\string.hpp
  hana\include\boost\hana\tuple.hpp

 BOOST_HANA_WORKAROUND_MSVC_EMPTYBASE
  hana\include\boost\hana\basic_tuple.hpp
  hana\include\boost\hana\pair.hpp
  hana\include\boost\hana\tuple.hpp
  hana\include\boost\hana\detail\integral_constant.hpp
  hana\test\detail\ebo.cpp

 BOOST_HANA_WORKAROUND_MSVC_PREPROCESSOR_616033
  hana\include\boost\hana\detail\preprocessor.hpp
  hana\include\boost\hana\detail\struct_macros.hpp

BTW,
1. There are some warnings which I don't fix. I will likely address them in a separate PR. They look legit and don't impact the build and tests.
2. Appveyor currently doesn't provide 15.8 Preview 5 which contains all the compiler fixes we made in the previous months. I plan to update appveyor.yml after Appveyor provides 15.8 RTM.
2018-08-22 16:59:34 -07:00
Louis Dionne
c92b2d64e1 [tests] Add automatic unit tests for 'ap' 2017-12-01 18:00:49 -08:00
Louis Dionne
154ddb4f83 [tests] Add missing automatic test cases and get rid of custom tests for Fusion 2017-11-26 14:18:07 -08:00
Jason Rice
6d086796a3 [index_if] New index_if function
- Adds index_if
    - Rewrites detail::index_if to use recursive alias stuff
      optimized for tuple and basic_tuple
    - find_if now uses index_if for Iterables
    - at_key now uses index_if for Sequence
    - Removes duplicate code and unnecessary special case implementations
        - detail::advance_until
        - at_key::advance_until
        - tuple_tag implementation of find_if
    - Uses Foldable instead of Sequence for cases where length is known.
      (find_if had a specialization when Iterable and not Sequence)
    - Adds test.*.auto.index_if for Sequences
    - Adds test support/counter for testing infinite iterables
2017-04-07 16:19:52 -07:00
Louis Dionne
a39d2fb90c [any_of] Fix a bug where we called the predicate once more than necessary
Also, add automatic unit tests for any_of, all_of and none_of. This commit
also makes it easier to add new automatic unit tests by documenting a small
shell script.

Commit triggered by http://stackoverflow.com/q/42012512/627587
2017-02-03 13:58:08 -08:00
Louis Dionne
9895803ede Bump copyright year to 2017 2017-01-07 14:14:18 -08:00
Louis Dionne
9fe9d2f0d7 Make sure concepts inherit from an integral_constant
Fixes #269
2016-11-17 08:41:27 +01:00
Louis Dionne
8fda2f482e [tests] Take by && instead of value when creating a ::seq
Closes #302, although I suspect #302 is caused by a codegen bug in Clang.
2016-10-08 15:55:13 -07:00
Louis Dionne
16c8dd84c6 [tests] Allow overriding TRACKED_PRINT_STUFF from an including file 2016-10-08 14:40:14 -07:00
Louis Dionne
3930c150e3 [tests] Remove support for subparts in the Sequence laws
The subparts were not used anywhere anymore.
2016-10-08 14:22:02 -07:00
Louis Dionne
6b99094b17 [tests] Inherit from integer instead of using alias to improve error messages 2016-10-08 14:18:15 -07:00
Louis Dionne
f06b35db8d [tests] Remove includes of the master header 2016-09-18 16:16:25 -07:00
Louis Dionne
83f3307ba5 [tests] Clean up messy includes 2016-09-18 13:49:35 -07:00
Louis Dionne
28f5a6bf74 [tests] Clean up some tests using ::Tracked 2016-09-18 12:12:55 -07:00
Louis Dionne
221a9b8d52 [tests] Use ::value instead of {} in implicit constexpr conversion 2016-08-30 19:18:27 -07:00
Louis Dionne
b8e28e4a74 [tests] Create an automatic test for for_each 2016-07-07 21:36:11 -07:00
Louis Dionne
b0d9676370 Fix obscure segfault with boost::tuple on Xcode 7.3 2016-06-19 12:28:09 -07:00
Louis Dionne
ec74204588 [scans] Fix undefined behaviour in scan_right and optimize both algorithms 2016-03-05 16:41:47 -05:00
Louis Dionne
9398b89210 [test/take_back] Rename misnamed automatic take_back test files
Also use smaller sequences to accommodate boost::tuple.
2016-02-29 10:24:26 -05:00
Louis Dionne
50a8bd3684 [tests] Add automatic unit tests for at 2016-02-29 09:08:05 -05:00
Louis Dionne
3475065f23 [tests] Add an automatic unit test for is_empty 2016-02-29 09:08:05 -05:00
Louis Dionne
a6438720c0 [tests] Add an automatic test for transform 2016-02-27 14:36:57 -05:00
Louis Dionne
6798df624e [tests] Reorganize the test/_support folder
- Rename test/_support to test/_include
- Move stuff from test/_include/test to test/_include/support
- Move stuff in test/_include/support into global namespace
2016-02-22 19:09:50 -05:00