diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-26 15:58:30 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-05-26 15:58:30 +0200 |
commit | 6e9dfefc8b353ce2cae650e6d3d68e38fcd12a8a (patch) | |
tree | a09faaa0d19f424be41c92477890b535cbbc0694 /bdep/diagnostics.hxx | |
parent | 8d841f1f893413518b5aa1894e96f1decee91808 (diff) |
Don't print empty location, zero line/column
Diffstat (limited to 'bdep/diagnostics.hxx')
-rw-r--r-- | bdep/diagnostics.hxx | 9 |
1 files changed, 8 insertions, 1 deletions
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; |