[stacktrace.entry.query]

# 19 Diagnostics library [[diagnostics]](./#diagnostics)

## 19.6 Stacktrace [[stacktrace]](stacktrace#entry.query)

### 19.6.3 Class stacktrace_entry [[stacktrace.entry]](stacktrace.entry#query)

#### 19.6.3.4 Query [stacktrace.entry.query]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1801)

[*Note [1](#note-1)*:

All the stacktrace_entry query functions treat
errors other than memory allocation errors
as âno information availableâ and do not throw in that case[.](#1.sentence-1)

â *end note*]

[ð](#lib:description,stacktrace_entry)

`string description() const;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1814)

*Returns*: A description of the evaluation represented by *this,
or an empty string[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1819)

*Throws*: bad_alloc if memory for
the internal data structures or the resulting string cannot be allocated[.](#3.sentence-1)

[ð](#lib:source_file,stacktrace_entry)

`string source_file() const;
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1831)

*Returns*: The presumed or actual name of the source file ([[cpp.predefined]](cpp.predefined "15.12 Predefined macro names"))
that lexically contains the expression or statement
whose evaluation is represented by *this, or an empty string[.](#4.sentence-1)

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1837)

*Throws*: bad_alloc if memory for
the internal data structures or the resulting string cannot be allocated[.](#5.sentence-1)

[ð](#lib:source_line,stacktrace_entry)

`uint_least32_t source_line() const;
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1849)

*Returns*: 0, or a 1-based line number that lexically relates to the evaluation
represented by *this[.](#6.sentence-1)

If source_file returns the presumed name of the source file,
returns the presumed line number;
if source_file returns the actual name of the source file,
returns the actual line number[.](#6.sentence-2)

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/diagnostics.tex#L1858)

*Throws*: bad_alloc if memory for
the internal data structures cannot be allocated[.](#7.sentence-1)
