AcademySoftwareFoundation / AcademySoftwareFoundation/Imath
ImathTest does not build with Apple Clang C++ 20
- Dominant language
- C++
- Stars
- 488
- Forks
- 161
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 3
Description
Apple Clang does not support `std::bit_cast()` which is used in src/ImathTest/testFun.cpp (https://en.cppreference.com/w/cpp/compiler_support), using Imath 3.1.6.
The problem could be resolved by using the already defined polyfill in the same file for Apple Clang.
So line 23 in src/ImathTest/testFun.cpp:
```c++
#if __cplusplus < 202002L
```
could become something like:
```c++
#if __cplusplus < 202002L || (__clang__ && __APPLE__)
```
Also line 11 in the same file could be changed to:
```c++
#if __cplusplus >= 202002L && !(__clang__ && __APPLE__)
```
since including is then no longer required.
Contributor guide
Research direction
Start with src/ImathTest/testFun.cpp and inspect the existing polyfill and the two preprocessor guards described in the issue. Build ImathTest with Apple Clang in C++20 mode to confirm the failure, then verify that the test target builds successfully without requiring .
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100