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

Avoid std::equal volatile comparisons for libc++ (#44) #52

Merged
merged 1 commit into from
Dec 15, 2019
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
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ addons:
- llvm-toolchain-trusty-4.0
- llvm-toolchain-trusty-5.0
- llvm-toolchain-trusty-6.0
- llvm-toolchain-trusty-8

matrix:
include:
Expand Down Expand Up @@ -132,6 +133,14 @@ matrix:
packages: ["clang-6.0", "g++-7", "python3-pip", "lcov"]
sources: *apt_sources

- os: linux
env: COMPILER=clang++-8 CXXFLAGS=-stdlib=libc++
compiler: clang
addons: &clang8
apt:
packages: ["clang-8", "g++-7", "python3-pip", "lcov", 'libc++-8-dev', 'libc++abi-8-dev']
sources: *apt_sources

- os: osx
osx_image: xcode7.3
compiler: clang
Expand Down
9 changes: 8 additions & 1 deletion test/span.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <ciso646>
#include "span-main.t.hpp"

#define DIMENSION_OF( a ) ( sizeof(a) / sizeof(0[a]) )
Expand Down Expand Up @@ -437,9 +438,15 @@ CASE( "span<>: Allows to copy-construct from another span of a compatible type"

span<const volatile int> x( v );
span<const volatile int> y( v );

#ifndef _LIBCPP_VERSION
EXPECT( std::equal( x.begin(), x.end(), arr ) );
EXPECT( std::equal( y.begin(), y.end(), arr ) );
#else
for(size_t i = 0; i < x.size(); ++i)
EXPECT(x[i] == arr[i]);
for(size_t i = 0; i < y.size(); ++i)
EXPECT(y[i] == arr[i]);
#endif
}

CASE( "span<>: Allows to copy-construct from a temporary span of the same type (C++11)" )
Expand Down