https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102350

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You'd need a different builtin (so that you know the presence of the builtin
means the new behavior), ideally tell the builtin some way the type it should
construct objects in (as opposed to std::source_location::__impl), because
otherwise you don't know how __builtin_source_location will behave (except for
libstdc++ where for GCC we expect to support only the same GCC/libstdc++
combo).
But more importantly, how would you use the builtin?  I expect not using the
builtin directly, so through a macro?  Otherwise, if it is some inline
function, you'd most likely get the location of the inline function and not
that of the caller.  That is part of the magic std::source_location::current
behavior where exactly takes the location from for the builtin...

Reply via email to