https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102350
Bug ID: 102350 Summary: __builtin_source_location not available in earlier language modes Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pdimov at gmail dot com Target Milestone: --- Currently, `__builtin_source_location` requires (a) `<source_location>` to be included and (b) -std=c++20. Are there good reasons for these restrictions? The builtin would still be extremely valuable in earlier language modes. Libraries that still support 03/11/14/17 (Boost.System, for instance) could transparently supply source locations by using a default `void const* loc = __builtin_source_location()` argument.