[#absl-Status-WithSourceLocation-06] = xref:absl.adoc[absl]::xref:absl/Status.adoc[Status]::WithSourceLocation :relfileprefix: ../../ :mrdocs: Returns a copy of the current status, with `loc` appended to its location chain iff the status is non‐ok and contains a non‐empty message. == Synopsis Declared in `<absl/status/status.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:absl/Status.adoc[Status] WithSourceLocation(xref:absl/SourceLocation.adoc[absl::SourceLocation] loc = absl::SourceLocation::current()) const &; ---- == Description Example: if (Status status = Foo(); !status.ok()) { return status.WithSourceLocation(); } == Return Value A copy of this status with `loc` appended. == Parameters [cols="1,4"] |=== | Name| Description | *loc* | The source location to append. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#