Comments (7)
Thank you for checking, indeed there is something wrong with the clang-15 version :/ the builtins seem not to work and clang-15 doesn't have access to <source_location>. I'll post on the llvm project to see whether anyone can take a look, thanks again for bringing that up.
from ut.
Hmm, that looks like the compiler used doesn't support source_location. Can you share the compiler and version used?
The following check is being done to detect support for the source location on the library side.
#if defined(__cpp_lib_source_location)
using source_location = std::source_location;
#else
class source_location {
public:
[[nodiscard]] static constexpr auto current(
#if (__has_builtin(__builtin_FILE) and __has_builtin(__builtin_LINE))
const char* file = __builtin_FILE(), int line = __builtin_LINE()
#else
const char* file = "unknown", int line = {}
#endif
from ut.
Ah, I see. I think I'm using the most recent Clang version on macOS
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin23.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
from ut.
Ohh, that's bad, it seems like clang-15 introduced some bug to their builtin :/
Looking at godbolt, clang<15 works, clang-15 doens't work and clang-trunk works again. gcc seem to work just fine in all available versions.
https://godbolt.org/z/8a183GWvv
Let me dig in a bit further to see whether there is a wknd for that or the clang broke soure_lcoation builtin alltogether in 15. Note. it's also affecting not Apple clang.
from ut.
It also seems related to clang using libstdc++ from gcc.
It seems to work on clang 15 with libc++. Do you use libstdc++ by any chance?
https://godbolt.org/z/3sn1MdM53
from ut.
Hmmm wow, this is strange!
I'm using libc++
, but I guess Apple's Clang distribution is broken, at least in this version then.
from ut.
Okay, I just tested with Clang 16 from brew and can confirm that works fine with std::source_location
, so I guess Apple will just have to sort it out in their own time...
from ut.
Related Issues (20)
- Comparing (and printing) char32_t
- piping tuple into a test case enforces const-ness of passed type instances
- running clang-format on ut.hpp in master produces changes?
- 7 tests fail
- Would be nice if the _i operator accepted hex constants HOT 1
- Boost review process
- `using namespace boost::ut;` breaks piping views that are copied to local variable.
- Test crashes in aarch64 built with clang++ HOT 1
- clang-scan-deps fails on ut.hpp
- Tests fail due to global instances destroyed HOT 1
- Leak when a source file starts with an A
- std::cout blocked from printing, is there an option to set?
- Version 2.0.1 segfaults when using std::format and std::cout on multiple threads HOT 22
- aborts support on Windows?
- Tests are always skipped when ut is #included into a module
- Number of asserts is reported wrongly
- Fatal expression with custom message compile error HOT 2
- Custom message for fatal expressions not shown
- Add the option to display a diff when comparing strings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ut.