Skip to content

Commit

Permalink
Fix error when compiling with Intel C++
Browse files Browse the repository at this point in the history
  • Loading branch information
lackhole committed Sep 9, 2024
1 parent 7db9a31 commit e11ab3f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion include/preview/__core/no_unique_address.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

#include "preview/__core/std_version.h"

#if PREVIEW_CXX_VERSION < 20
// TODO: Check using CheckCxxSourceCompiles
#if PREVIEW_CXX_VERSION < 20 || defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
#define PREVIEW_NO_UNIQUE_ADDRESS
#else
#define PREVIEW_NO_UNIQUE_ADDRESS [[no_unique_address]]
Expand Down
4 changes: 2 additions & 2 deletions test/ranges_concepts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ TEST(VERSIONED(RangesConcepts), bidirectional_range) {
EXPECT_TRUE_TYPE(ranges::bidirectional_range<std::set<int>>);
EXPECT_TRUE_TYPE(ranges::bidirectional_range<std::list<int>>);

// MSVC's hash container models bidirectional range (iterator is from std::list)
#if defined(_MSC_VER) && !defined(__llvm__) && !defined(__INTEL_COMPILER)
// MSVC and Intel C++: hash container models bidirectional range (iterator is from std::list)
#if defined(_MSC_VER)
EXPECT_TRUE_TYPE(ranges::bidirectional_range<std::unordered_map<int, int>>);
EXPECT_TRUE_TYPE(ranges::bidirectional_range<std::unordered_set<int>>);
#else
Expand Down
5 changes: 5 additions & 0 deletions test/ranges_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,13 @@ TEST(VERSIONED(RangesViews), transform_view) {
EXPECT_DOUBLE_EQ(out[4], 3.339682539682540);
EXPECT_DOUBLE_EQ(out[5], 3.041839618929403);
EXPECT_DOUBLE_EQ(out[6], 3.131592903558554);
#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)
EXPECT_FLOAT_EQ (out[7], 3.140592653839794);
EXPECT_FLOAT_EQ (out[8], 3.141591653589774);
#else
EXPECT_DOUBLE_EQ(out[7], 3.140592653839794);
EXPECT_DOUBLE_EQ(out[8], 3.141591653589774);
#endif
}

{
Expand Down

0 comments on commit e11ab3f

Please sign in to comment.