[#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&hyphen;ok and contains a non&hyphen;empty message&period;

== Synopsis

Declared in `&lt;absl&sol;status&sol;status&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:absl/Status.adoc[Status]
WithSourceLocation(xref:absl/SourceLocation.adoc[absl::SourceLocation] loc = absl&colon;&colon;SourceLocation&colon;&colon;current()) const &amp;;
----

== Description

Example&colon;

if (Status status &equals; Foo()&semi; !status&period;ok()) &lcub; return status&period;WithSourceLocation()&semi; &rcub;

== Return Value

A copy of this status with `loc` appended&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *loc*
| The source location to append&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
