https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102350
--- Comment #2 from Peter Dimov <pdimov at gmail dot com> --- (In reply to Jakub Jelinek from comment #1) > __builtin_source_location doesn't require -std=c++20, but indeed does > require <source_location> or some compatible definition of > std::source_location::__impl class, and as it doesn't have hardcoded layout > of that structure but instead matches whatever the source header provides > (looks up fields it needs in there and uses whatever types and layout they > have), there is no way around that. That was my guess. I suppose that's inevitable then, and there's nothing to ask for on the compiler side, <source_location> just needs to not disable itself completely for pre-C++20 as it does now. (It's not going to work, but it can still provide __impl so that the builtin can see it.)