From edab35e216bc3839915129e54f98160428634283 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 12 Aug 2019 14:56:03 +0300 Subject: Add support for default options files --- bdep/diagnostics.hxx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'bdep/diagnostics.hxx') diff --git a/bdep/diagnostics.hxx b/bdep/diagnostics.hxx index 89d8ac8..40b2d11 100644 --- a/bdep/diagnostics.hxx +++ b/bdep/diagnostics.hxx @@ -5,7 +5,7 @@ #ifndef BDEP_DIAGNOSTICS_HXX #define BDEP_DIAGNOSTICS_HXX -#include // forward() +#include // move(), forward() #include @@ -98,8 +98,8 @@ namespace bdep // 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 (string f, uint64_t l = 0, uint64_t c = 0) + : file (std::move (f)), line (l), column (c) {} location () = default; @@ -118,6 +118,11 @@ namespace bdep const location& l) : type_ (type), name_ (name), loc_ (l) {} + location_prologue_base (const char* type, + const char* name, + const path& f) + : type_ (type), name_ (name), loc_ (f.string ()) {} + void operator() (const diag_record& r) const; @@ -151,10 +156,18 @@ namespace bdep return location_prologue (epilogue_, type_, name_, l); } + location_prologue + operator() (const path& f) const + { + return location_prologue (epilogue_, type_, name_, f); + } + template location_prologue operator() (const L& l) const { + // get_location() is the user-supplied ADL-searched function. + // return location_prologue ( epilogue_, type_, name_, get_location (l, data_)); } -- cgit v1.1