From 6e9dfefc8b353ce2cae650e6d3d68e38fcd12a8a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 26 May 2018 15:58:30 +0200 Subject: Don't print empty location, zero line/column --- bdep/diagnostics.hxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bdep/diagnostics.hxx') diff --git a/bdep/diagnostics.hxx b/bdep/diagnostics.hxx index b094457..521af23 100644 --- a/bdep/diagnostics.hxx +++ b/bdep/diagnostics.hxx @@ -95,10 +95,17 @@ namespace bdep class location { public: - location () {} + // Zero lines or columns are not printed. + // + explicit location (string f, uint64_t l, uint64_t c) : file (move (f)), line (l), column (c) {} + location () = default; + + bool + empty () const {return file.empty ();} + string file; uint64_t line; uint64_t column; -- cgit v1.1