Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Bugfix: fix issue 145 compile on VS 2022 #146

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/main_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ jobs:
matrix:
build_type: [Debug, Release]
sharedlibs: [OFF, ON]
std: [14, 17, 20]

runs-on: windows-2019
runs-on: windows-2022

steps:
- uses: actions/checkout@v2
Expand All @@ -91,7 +92,7 @@ jobs:
- name: Configure
shell: bash
working-directory: build/
run: cmake $GITHUB_WORKSPACE -G"Visual Studio 16 2019" -DBUILD_SHARED_LIBS=${{matrix.sharedlibs}}
run: cmake $GITHUB_WORKSPACE -G"Visual Studio 17 2022" -DCMAKE_CXX_STANDARD=${{matrix.std}} -DBUILD_SHARED_LIBS=${{matrix.sharedlibs}}
- name: Build
working-directory: build/
run: cmake --build . --config ${{matrix.build_type}}
Expand Down
4 changes: 2 additions & 2 deletions include/foonathan/memory/allocator_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace foonathan
FOONATHAN_REQUIRES(
(!std::is_base_of<allocator_storage, typename std::decay<Alloc>::type>::value))>
allocator_storage(Alloc&& alloc,
FOONATHAN_SFINAE(new storage_policy(detail::forward<Alloc>(alloc))))
FOONATHAN_SFINAE(new storage_policy(std::declval<Alloc>())))
: storage_policy(detail::forward<Alloc>(alloc))
{
}
Expand All @@ -137,7 +137,7 @@ namespace foonathan
/// otherwise this constructor does not participate in overload resolution.
template <class OtherPolicy>
allocator_storage(const allocator_storage<OtherPolicy, Mutex>& other,
FOONATHAN_SFINAE(new storage_policy(other.get_allocator())))
FOONATHAN_SFINAE(new storage_policy(std::declval<const allocator_storage<OtherPolicy, Mutex>&>().get_allocator())))
: storage_policy(other.get_allocator())
{
}
Expand Down
4 changes: 2 additions & 2 deletions include/foonathan/memory/std_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace foonathan
// MSVC seems to ignore access rights in decltype SFINAE below
// use this to prevent this constructor being chosen instead of move/copy for types inheriting from it
FOONATHAN_REQUIRES((!std::is_base_of<std_allocator, RawAlloc>::value))>
std_allocator(RawAlloc& alloc, FOONATHAN_SFINAE(alloc_reference(alloc))) noexcept
std_allocator(RawAlloc& alloc, FOONATHAN_SFINAE(alloc_reference(std::declval<RawAlloc&>()))) noexcept
: alloc_reference(alloc)
{
}
Expand All @@ -149,7 +149,7 @@ namespace foonathan
// MSVC seems to ignore access rights in decltype SFINAE below
// use this to prevent this constructor being chosen instead of move/copy for types inheriting from it
FOONATHAN_REQUIRES((!std::is_base_of<std_allocator, RawAlloc>::value))>
std_allocator(const RawAlloc& alloc, FOONATHAN_SFINAE(alloc_reference(alloc))) noexcept
std_allocator(const RawAlloc& alloc, FOONATHAN_SFINAE(alloc_reference(std::declval<const RawAlloc&>()))) noexcept
: alloc_reference(alloc)
{
}
Expand Down