aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/error.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/error.hh')
-rw-r--r--src/libutil/error.hh7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libutil/error.hh b/src/libutil/error.hh
index be5c5e252..c04dcbd77 100644
--- a/src/libutil/error.hh
+++ b/src/libutil/error.hh
@@ -71,6 +71,13 @@ struct AbstractPos
uint32_t column = 0;
/**
+ * An AbstractPos may be a "null object", representing an unknown position.
+ *
+ * Return true if this position is known.
+ */
+ inline operator bool() const { return line != 0; };
+
+ /**
* Return the contents of the source file.
*/
virtual std::optional<std::string> getSource() const